Cleaned up project
This commit is contained in:
@@ -141,9 +141,8 @@ public class Controls : MonoBehaviour
|
||||
fight.GetComponent<Fight>().startFight(worldGen.GetComponent<WorldGenerator>().getCurrentTile(), target, player);
|
||||
break;
|
||||
case "Tree":
|
||||
playParticle(target);
|
||||
StartCoroutine(playParticle(target));
|
||||
GameObject.Find("Inventory").GetComponent<Inventory>().addItem(new Item("Wood"));
|
||||
//Destroy(target);
|
||||
break;
|
||||
case "Stone":
|
||||
GameObject.Find("Inventory").GetComponent<Inventory>().addItem(new Item("Rock"));
|
||||
@@ -182,7 +181,7 @@ public class Controls : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void playParticle(GameObject target)
|
||||
IEnumerator playParticle(GameObject target)
|
||||
{
|
||||
Vector3 playerPos = player.transform.position;
|
||||
playerPos.y = target.transform.position.y;
|
||||
@@ -191,6 +190,8 @@ public class Controls : MonoBehaviour
|
||||
ParticleSystem.ShapeModule shape = particleSystem.shape;
|
||||
shape.rotation = newRotation.eulerAngles;
|
||||
particleSystem.Play();
|
||||
yield return new WaitUntil(() => !particleSystem.isPlaying);
|
||||
Destroy(target);
|
||||
}
|
||||
|
||||
public void OnInventory()
|
||||
|
||||
Reference in New Issue
Block a user