branch from homebase, icebolt collision issues

This commit is contained in:
joonasp 2022-04-11 13:58:13 +03:00
parent 6f7c3eaa9b
commit f7734432cc
17 changed files with 39785 additions and 373 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

@ -157,12 +157,12 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3757395767074346460}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ee8103568a01d804d89cb1fc1dff91eb, type: 3}
m_Name:
m_EditorClassIdentifier:
particles: {fileID: 8844865646353305354}
particles: {fileID: 0}
flySpeed: 10
testForce: 1000
--- !u!114 &3757395767037568670
@ -379,9 +379,3 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 6456652935746308080}
m_PrefabAsset: {fileID: 0}
--- !u!198 &8844865646353305354 stripped
ParticleSystem:
m_CorrespondingSourceObject: {fileID: 2532683062447540474, guid: 16595acc1c95e1843870f6d5ed6b3ad8,
type: 3}
m_PrefabInstance: {fileID: 6456652935746308080}
m_PrefabAsset: {fileID: 0}

View File

@ -12,6 +12,8 @@ public class ActionGestureInteraction : MonoBehaviour
private GameObject player;
public float projectileSpeed = 30;
private bool holdingWand;
void Start()
{
player = gameObject;
@ -19,8 +21,61 @@ public class ActionGestureInteraction : MonoBehaviour
public void PerformAction(string action)
{
Debug.Log(action);
if (action == "Portal")
Debug.LogWarning(action);
if (player.GetComponent<PlayerInfo>().GetRightHand() != null)
{
Debug.LogWarning(player.GetComponent<PlayerInfo>().GetRightHand().name);
if (player.GetComponent<PlayerInfo>().GetRightHand().name.Equals("wand")) holdingWand = true;
}
switch (action)
{
case "HorizontalLine":
if (holdingWand)
{
Debug.LogWarning("CAST BOLT");
ShootProjectile();
InstantiateIceBolt(objects[0]);
}
else
{
Debug.LogWarning("WOODCUTTING ACTION");
}
return;
case "VerticalLine":
if (holdingWand)
{
Debug.LogWarning("WAND VERTICAL");
}
else
{
Debug.LogWarning("VERTICAL");
}
return;
case "Circle":
if (holdingWand)
{
Debug.LogWarning("WAND CIRCLE");
}
else
{
Debug.LogWarning("CIRCLE");
}
return;
case "Triangle":
if (holdingWand)
{
Debug.LogWarning("WAND TRIANGLE");
}
else
{
Debug.LogWarning("WOODCUTTING ACTION");
}
return;
}
/*if (action == "Portal")
{
// Raycast to find portal were looking at.
var nearestPortal = FindPortalInFront();
@ -41,7 +96,7 @@ public class ActionGestureInteraction : MonoBehaviour
// Make ice wall appear from below to block incoming projectiles
}
}
}
} */
}
void EnableDisablePortal(GameObject portal)
{
@ -104,6 +159,7 @@ public class ActionGestureInteraction : MonoBehaviour
void InstantiateIceBolt(GameObject item)
{
Debug.LogWarning("INSTANTIATE BOLT");
var projectileObj = Instantiate(item, rightHandTransform.position, playerCamera.transform.rotation) as GameObject;
projectileObj.GetComponent<Rigidbody>().velocity = (destination - rightHandTransform.position).normalized * projectileSpeed;
}

View File

@ -0,0 +1,70 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerInfo : MonoBehaviour
{
private int health;
private int essence_basic;
private GameObject rightHandHeld;
private GameObject leftHandHeld;
private void Awake()
{
health = 5;
essence_basic = 0;
rightHandHeld = null;
leftHandHeld = null;
}
public void AddHealth(int value)
{
health += value;
if (health <= 0)
{
Debug.Log("NO HEALTH REAMINING");
}
}
public void AddEssenceBasic(int value)
{
if (essence_basic + value < 0)
{
Debug.Log("NOT ENOUGH ESSENCE");
}
else essence_basic += value;
}
public void AddLeftHand(GameObject obj)
{
leftHandHeld = obj;
}
public void AddRightHand(GameObject obj)
{
rightHandHeld = obj;
}
public void RemoveLeftHand()
{
leftHandHeld = null;
}
public void RemoveRightHand()
{
rightHandHeld = null;
}
public GameObject GetLeftHand()
{
return leftHandHeld;
}
public GameObject GetRightHand()
{
return rightHandHeld;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 51150922d2ca8cc44b6fc27d9365a8d4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: da52a93af762fab4ab9085821b0fb632
guid: 97fc7747e77335e4483b4a65db2e4fc1
DefaultImporter:
externalObjects: {}
userData:

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:

View File

@ -90,19 +90,19 @@ Material:
- _HorizonCloudSize: 4.91
- _HorizonCloudStartPosition: -0.1
- _HorizonCloudStep: 25
- _HorizonExponent: 3.5466661
- _HorizonExponent: 3.4428504
- _HorizonStep: 500
- _HorizonThickness: 1
- _MoonGlow: 0
- _MoonLightIntensity: 0.0000007231308
- _MoonLightIntensity: 0.000028431416
- _MoonSize: 0
- _MoonSoftEdge: 0
- _OverheadCloudAltitude: 1000
- _OverheadCloudAnimationSpeed: 50
- _OverheadCloudFlowDirectionX: 1
- _OverheadCloudFlowDirectionZ: 1
- _OverheadCloudRemapMax: 1.1412175
- _OverheadCloudRemapMin: 0.1597577
- _OverheadCloudRemapMax: 1.094984
- _OverheadCloudRemapMin: 0.12824413
- _OverheadCloudSize: 10
- _OverheadCloudStep: 2
- _StarsDensity0: 0.4
@ -121,25 +121,25 @@ Material:
- _StarsTwinkle1: 6
- _StarsTwinkle2: 2
- _SunGlow: 0.45
- _SunLightIntensity: 0.3000374
- _SunLightIntensity: 0.24817863
- _SunSize: 0.1
- _SunSoftEdge: 0.5
m_Colors:
- _DetailOverlayTintColor: {r: 0, g: 0, b: 0, a: 0}
- _FogColor: {r: 0, g: 0, b: 0, a: 0}
- _GroundColor: {r: 0.417616, g: 0.398888, b: 0.43516326, a: 1}
- _GroundColor: {r: 0.4126587, g: 0.39280373, b: 0.43126184, a: 1}
- _HorizonCloudColor: {r: 1, g: 1, b: 1, a: 1}
- _HorizonColor: {r: 0.90228546, g: 0.8623009, b: 0.76094025, a: 1}
- _HorizonColor: {r: 0.90445215, g: 0.8557181, b: 0.74831796, a: 1}
- _MoonColor: {r: 1, g: 1, b: 1, a: 0}
- _MoonDirection: {r: 1, g: 1, b: 1, a: 0}
- _MoonLightColor: {r: 0, g: 0, b: 0, a: 0}
- _OverheadCloudColor: {r: 1, g: 1, b: 1, a: 0.97479546}
- _SkyColor: {r: 0.21923709, g: 0.39015797, b: 0.62960136, a: 1}
- _OverheadCloudColor: {r: 1, g: 1, b: 1, a: 0.9677161}
- _SkyColor: {r: 0.21007125, g: 0.3664659, b: 0.60232735, a: 1}
- _StarsColor0: {r: 0.96470594, g: 0.9450981, b: 0.76470596, a: 1}
- _StarsColor1: {r: 1, g: 0.5294118, b: 0.93725497, a: 1}
- _StarsColor2: {r: 0, g: 0.92549026, b: 1, a: 1}
- _SunColor: {r: 0.97271293, g: 0.9276878, b: 0.85339636, a: 1}
- _SunDirection: {r: 0, g: -0.3628407, b: 0.9318512, a: 0}
- _SunColor: {r: 0.97372705, g: 0.93037534, b: 0.858845, a: 1}
- _SunDirection: {r: 0, g: -0.29469347, b: 0.95559186, a: 0}
- _SunLightColor: {r: 1, g: 0.9929226, b: 0.9009434, a: 1}
m_BuildTextureStacks: []
--- !u!114 &11400000

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,17 +27,17 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorBlend:
m_Texture: {fileID: 3169759487905746956, guid: b6bbea2e1167a7346822545139402874,
m_Texture: {fileID: 2713173277972343999, guid: b6bbea2e1167a7346822545139402874,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByHeight:
m_Texture: {fileID: 8080748522712846612, guid: b6bbea2e1167a7346822545139402874,
m_Texture: {fileID: -3898369796010551796, guid: b6bbea2e1167a7346822545139402874,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByNormal:
m_Texture: {fileID: -8809925349446740742, guid: b6bbea2e1167a7346822545139402874,
m_Texture: {fileID: -3196768955630093839, guid: b6bbea2e1167a7346822545139402874,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}

View File

@ -40,17 +40,17 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorBlend:
m_Texture: {fileID: -5816349128987467882, guid: 726ce83d589353742be6b48ff467fc48,
m_Texture: {fileID: 1178302760151159978, guid: 726ce83d589353742be6b48ff467fc48,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByHeight:
m_Texture: {fileID: 248416167985974953, guid: 726ce83d589353742be6b48ff467fc48,
m_Texture: {fileID: 7638727188211499746, guid: 726ce83d589353742be6b48ff467fc48,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByNormal:
m_Texture: {fileID: -3256142748054330089, guid: 726ce83d589353742be6b48ff467fc48,
m_Texture: {fileID: 3500522769472979249, guid: 726ce83d589353742be6b48ff467fc48,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}

View File

@ -40,17 +40,17 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorBlend:
m_Texture: {fileID: -5733606487837795199, guid: 7f589c682d367b442b8cf75918f5aa55,
m_Texture: {fileID: -7459891758008157300, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByHeight:
m_Texture: {fileID: -4942859769579248395, guid: 7f589c682d367b442b8cf75918f5aa55,
m_Texture: {fileID: 9029390223674640076, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorByNormal:
m_Texture: {fileID: -5686912380915963795, guid: 7f589c682d367b442b8cf75918f5aa55,
m_Texture: {fileID: -4646601084344554280, guid: 7f589c682d367b442b8cf75918f5aa55,
type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}