// void FixedUpdate() // { // this.transform.localScale = Vector3.Lerp (this.transform.localScale, Vector3.one, Time.deltaTime * 2f); // } public static void SimpleExplosion(GameObject ding) { DiceCollisionScript dcs = ding.GetComponent <DiceCollisionScript> (); GameObject explosionAnimation = (GameObject)Resources.Load <GameObject> ("Boom"); GameObject vfx = (GameObject)Instantiate(explosionAnimation, dcs.transform.position, dcs.transform.rotation); DestroyObject(vfx, 1.5f); }
public void OnClick() { obj = GameObject.FindGameObjectsWithTag("Dice"); foreach (GameObject objein in obj) { if (objein.name == whichObjectToDestroy) { if (objein != null) { DiceCollisionScript.IncreaseScore(objein); DiceCollisionScript.SimpleExplosion(objein); Spawn.PutCubeBack(objein); } } } }
public static void IncreaseScore(GameObject ding) { DiceCollisionScript dcs = ding.GetComponent <DiceCollisionScript> (); Score += dcs.zahlwert; }