Skip to content

Commit

Permalink
Indev 8 update
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Feb 16, 2023
1 parent f0b2349 commit 893473c
Show file tree
Hide file tree
Showing 450 changed files with 36,887 additions and 23,644 deletions.
6 changes: 6 additions & 0 deletions Assembly-CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,26 @@
<Analyzer Include="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Visual Studio Tools for Unity\Analyzers\Microsoft.Unity.Analyzers.dll" />
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\CloseChestGUI.cs" />
<Compile Include="Assets\Item.cs" />
<Compile Include="Assets\Code\MapGenerator.cs" />
<Compile Include="Assets\ItemDisplay.cs" />
<Compile Include="Assets\ActivatedSlotDisplay.cs" />
<Compile Include="Assets\Code\CameraController.cs" />
<Compile Include="Assets\Touchable.cs" />
<Compile Include="Assets\ChestRightClick.cs" />
<Compile Include="Assets\Chunk.cs" />
<Compile Include="Assets\Code\SeedOK.cs" />
<Compile Include="Assets\GetCraftResultItem.cs" />
<Compile Include="Assets\Code\MapGenRNG.cs" />
<Compile Include="Assets\BlockEventArgs.cs" />
<Compile Include="Assets\Register.cs" />
<Compile Include="Assets\Test.cs" />
<Compile Include="Assets\Code\PlayerController.cs" />
<Compile Include="Assets\EventArgs.cs" />
<Compile Include="Assets\ItemStack.cs" />
<Compile Include="Assets\Inventory.cs" />
<Compile Include="Assets\BlockPlaceEventArgs.cs" />
<Compile Include="Assets\CraftingChecker.cs" />
<Compile Include="Assets\InventoryGUIClose.cs" />
<Compile Include="Assets\ShapedCrafting.cs" />
Expand Down
86 changes: 86 additions & 0 deletions Assets/BlockData.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Events;

public class BlockData : MonoBehaviour
{
public int BlockID;
public int DropItem;
public List<int> BreakSound;
public List<int> PlaceSound;
public UnityEvent<BlockRightClickEventArgs> OnRightClick;
// Current Not Working
public UnityEvent<BlockPlaceEventArgs> OnPlace;
void Start()
{
//VisibleCheck();
}
public void DestroyBlock()
{
GameObject.Find("Register").GetComponent<AudioSource>().PlayOneShot(GameObject.Find("Register").GetComponent<Register>().audioClips[BreakSound[Random.Range(0, BreakSound.Count)]]);
Expand Down Expand Up @@ -36,6 +45,83 @@ public void DestroyBlock()
}
}*/
inv.AddItem(new ItemStack(DropItem, 1));
GameObject.Find("Register").GetComponent<Register>().placedBlocks.Remove(gameObject);
//foreach (GameObject b in GameObject.Find("Register").GetComponent<Register>().placedBlocks.ToArray())
//{
// b.GetComponent<BlockData>().VisibleCheck();
//}
Destroy(gameObject);
}
// Not Working
public void VisibleCheck()
{
bool[] flag = new bool[6];
//GameObject[] blocks = GameObject.Find("Register").GetComponent<Register>().placedBlocks.ToArray();
List<Transform> blocks = new List<Transform>();
foreach (Transform child in transform.parent)
{
blocks.Add(child);
}
//GameObject[] blocks = transform.parent.GetEnumerator(.ToArray()

foreach (Transform block in blocks)
{
//Debug.Log($"Block COMP ({block.transform.position}, {transform.position}");
Vector3 vector = block.position - transform.position;
//if (block.transform.position.x - transform.position.x <= 1)
//{
// flag[0] = true;
//}
//else if (block.transform.position.x - transform.position.x >= -1)
//{
// flag[1] = true;
//}
//else if (block.transform.position.y - transform.position.y <= 1)
//{
// flag[2] = true;
//}
//else if (block.transform.position.y - transform.position.y >= -1)
//{
// flag[3] = true;
//}
//else if (block.transform.position.z - transform.position.z <= 1)
//{
// flag[4] = true;
//}
//else if (block.transform.position.z - transform.position.z >= -1)
//{
// flag[5] = true;
//}
if (vector == new Vector3(1, 0, 0))
{
flag[0] = true;
}
else if (vector == new Vector3(-1, 0, 0))
{
flag[1] = true;
}
else if (vector == new Vector3(0, 1, 0))
{
flag[2] = true;
}
else if (vector == new Vector3(0, -1, 0))
{
flag[3] = true;
}
else if (vector == new Vector3(0, 0, 1))
{
flag[4] = true;
}
else if (vector == new Vector3(0, 0, -1))
{
flag[5] = true;
}
if (!flag.Contains(false))
{
break;
}
}
Debug.Log(string.Join(", ", flag));
gameObject.SetActive(flag.Contains(false));
}
}
19 changes: 19 additions & 0 deletions Assets/BlockEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BlockRightClickEventArgs
{
/// <summary>
/// 기본 우클릭 동작 (블럭 설치) 취소 여부
/// </summary>
public bool Handled;
/// <summary>
/// 해당 블록
/// </summary>
public GameObject block;
/// <summary>
/// 클릭된 면
/// </summary>
public Vector3 side;
}
11 changes: 11 additions & 0 deletions Assets/BlockEventArgs.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions Assets/BlockModel/Materials/chest.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: chest
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: f25db26b2f757ad48b58f09bbfcf61ef, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
8 changes: 8 additions & 0 deletions Assets/BlockModel/Materials/chest.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions Assets/BlockModel/Materials/oak_log.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: oak_log
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 919bcc49355836c44aaed007524ce2a7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
8 changes: 8 additions & 0 deletions Assets/BlockModel/Materials/oak_log.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 893473c

Please sign in to comment.