small fixes

This commit is contained in:
joonasp 2022-05-16 17:47:54 +03:00
parent 9a104a8bd3
commit 86d16e0cf2
23 changed files with 11245 additions and 9795 deletions

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 10f2e5d2e4dd2ba42b4dcf6195a74f02
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 8bc88477f037e96478019bba8de301fd
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -40,7 +40,7 @@ MeshFilter:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 788300690735002878}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &9000270122588691705
MeshRenderer:
m_ObjectHideFlags: 0
@ -61,7 +61,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 883bbd715dd7e2e428aa32e0c388722a, type: 2}
- {fileID: 2100000, guid: b16f64f428b405845a02e79478239092, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0

View File

@ -412,6 +412,7 @@ Transform:
- {fileID: 2498142198288847795}
- {fileID: 2498142196473246274}
- {fileID: 2498142196498008887}
- {fileID: 7144326527911497039}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -498,3 +499,128 @@ MonoBehaviour:
output: {fileID: 2498142196498008887}
startWand: {fileID: 7748908063851026723, guid: d3af4ebc0ff721d4fbcc988713bb674c,
type: 3}
--- !u!1001 &832023859129202319
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 4613100203587676735}
m_Modifications:
- target: {fileID: 7543052554150911968, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: onDown.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7543052554150911968, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: onDown.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7543052554150911968, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: onDown.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 2498142198148501413}
- target: {fileID: 7543052554150911968, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: onDown.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 7543052554150911968, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: onDown.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: Craft
objectReference: {fileID: 0}
- target: {fileID: 7543052554150911968, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: onDown.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: CraftingTable, Assembly-CSharp
objectReference: {fileID: 0}
- target: {fileID: 7543052554150911968, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: onDown.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355069, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_Name
value: Lever (1)
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalScale.x
value: 0.099999994
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalScale.y
value: 0.10000001
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalScale.z
value: 0.10000001
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalPosition.x
value: -0.96562576
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalPosition.y
value: 1.348712
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.6680527
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.6532815
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.27059805
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalRotation.y
value: 0.6532815
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalRotation.z
value: 0.27059805
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90
objectReference: {fileID: 0}
- target: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 45
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cb8b19b563b3d224897e3b3d94c353aa, type: 3}
--- !u!4 &7144326527911497039 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7543052554475355072, guid: cb8b19b563b3d224897e3b3d94c353aa,
type: 3}
m_PrefabInstance: {fileID: 832023859129202319}
m_PrefabAsset: {fileID: 0}

View File

@ -12,9 +12,10 @@ GameObject:
- component: {fileID: 8183020133483952674}
- component: {fileID: 8183020133484680894}
- component: {fileID: 8183020133918107436}
- component: {fileID: 5150078753582545515}
m_Layer: 0
m_Name: EssenceWell
m_TagString: Untagged
m_TagString: Portal
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@ -103,3 +104,16 @@ MonoBehaviour:
rightDistance: 0.1
maxUp: 0.2
minDown: -0.2
--- !u!135 &5150078753582545515
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8183020133482818824}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.06824422
m_Center: {x: -1.0587912e-21, y: 0.000000018626455, z: -4.4408925e-15}

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: da52a93af762fab4ab9085821b0fb632
DefaultImporter:
guid: 81799bac27ab6ed41a883ff29743cf2b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:

View File

@ -28,18 +28,21 @@ public class CuttableTree : MonoBehaviour
{
if (other.tag == "Cutter")
{
rotation = transform.rotation;
rotation *= Quaternion.AngleAxis(20, Vector3.up);
Instantiate(stumpPrefab, transform.position, rotation);
Instantiate(logPrefab, transform.position + new Vector3(0, 1, 0), rotation);
onCut.Invoke();
Destroy(gameObject);
Cut();
}
}
void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Cutter")
{
Cut();
}
}
public void Cut()
{
Debug.LogWarning("CUT");
rotation = transform.rotation;
rotation *= Quaternion.AngleAxis(20, Vector3.up);
Instantiate(stumpPrefab, transform.position, rotation);
@ -47,6 +50,4 @@ public class CuttableTree : MonoBehaviour
onCut.Invoke();
Destroy(gameObject);
}
}
}

View File

@ -29,7 +29,7 @@ public class SlimeAI : MonoBehaviour
{
animator = GetComponent<Animator>();
player = GameObject.FindWithTag("Player");
HP = 0;
HP = 5;
}
@ -141,6 +141,7 @@ public class SlimeAI : MonoBehaviour
{
yield return new WaitForSeconds(0.2f);
Debug.Log("Attack");
PlayerInfo.Instance.AddHealth(-1);
//do attack e.g check for player in range/hit collider
}

View File

@ -27,7 +27,6 @@ public class ActionGestureInteraction : MonoBehaviour
{
Debug.LogWarning(action);
Debug.LogWarning(player.GetComponent<PlayerInfo>().GetRightHand());
if (player.GetComponent<PlayerInfo>().GetRightHand() != null)
{
@ -52,7 +51,13 @@ public class ActionGestureInteraction : MonoBehaviour
}
else
{
Debug.LogWarning("WOODCUTTING ACTION");
GameObject tree = FindTree();
if (tree != null)
{
float distance = Vector3.Distance(transform.position, tree.transform.position);
Debug.LogWarning("TREE FOUND: " + distance);
if (distance < 6f) tree.GetComponent<CuttableTree>().Cut();
}
}
break;
case "VerticalLine":
@ -101,7 +106,7 @@ public class ActionGestureInteraction : MonoBehaviour
}
else
{
Debug.LogWarning("WOODCUTTING ACTION");
}
break;
}
@ -172,6 +177,22 @@ public class ActionGestureInteraction : MonoBehaviour
return null;
}
GameObject FindTree()
{
Ray ray = playerCamera.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0));
RaycastHit hit;
LayerMask playerLayerMask = LayerMask.GetMask("Player");
if (Physics.Raycast(ray, out hit, playerLayerMask))
{
if (hit.transform.gameObject.transform.name.StartsWith("Cuttable_Tree_"))
{
return hit.transform.gameObject;
}
}
return null;
}
void ShootProjectile()
{
Ray ray = playerCamera.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0));

View File

@ -26,7 +26,7 @@ public class EssenceNodeController : MonoBehaviour
{
nodeMaterial = GetComponent<Renderer>().material;
playerInfo = PlayerInfo.Instance;
playerInventory = GameObject.Find("Inventory").GetComponent<Inventory>();
//playerInventory = GameObject.Find("Inventory").GetComponent<Inventory>();
}
public void Touched()
@ -65,7 +65,7 @@ public class EssenceNodeController : MonoBehaviour
playerInfo.AddEssenceBasic(1);
yield return new WaitForSeconds(2f);
//TODO: Update value in player inventory
playerInventory.AddItem(GetComponent<ItemData>());
//playerInventory.AddItem(GetComponent<ItemData>());
Destroy(gameObject);
}

View File

@ -18,7 +18,7 @@ public class PlayerInfo : MonoBehaviour
{
Instance = this;
health = 5;
essence_basic = 1000;
essence_basic = 1;
rightHandHeld = null;
leftHandHeld = null;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 3829f2d229e9f9b44b6d3f85cb2d6653
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 2dc48376fb0fbaa4f93eb47a43ad6560
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -27,15 +27,18 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorBlend:
m_Texture: {fileID: 0}
m_Texture: {fileID: 8715377698828041336, guid: b6bbea2e1167a7346822545139402874,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByHeight:
m_Texture: {fileID: 0}
m_Texture: {fileID: 4117164932860373842, guid: b6bbea2e1167a7346822545139402874,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByNormal:
m_Texture: {fileID: 0}
m_Texture: {fileID: 8483472128022604842, guid: b6bbea2e1167a7346822545139402874,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:

View File

@ -40,15 +40,18 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorBlend:
m_Texture: {fileID: 0}
m_Texture: {fileID: 7633147346474026742, guid: 726ce83d589353742be6b48ff467fc48,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByHeight:
m_Texture: {fileID: 0}
m_Texture: {fileID: 3867667019844413430, guid: 726ce83d589353742be6b48ff467fc48,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByNormal:
m_Texture: {fileID: 0}
m_Texture: {fileID: 1556245102416868720, guid: 726ce83d589353742be6b48ff467fc48,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:

View File

@ -40,15 +40,18 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorBlend:
m_Texture: {fileID: 0}
m_Texture: {fileID: 8453615220865481238, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByHeight:
m_Texture: {fileID: 0}
m_Texture: {fileID: -6360736566364471894, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByNormal:
m_Texture: {fileID: 0}
m_Texture: {fileID: 71292903075132233, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
@ -73,7 +76,8 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 47a91f8808e6f334a84f127655c54663, type: 3}
m_Texture: {fileID: -1060774955752299741, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap: