void PlacePumpkin(Vector3 position) { GameObject pumpkin = Instantiate(clickedSelection.pumpkinPrefab, position, Quaternion.identity); if (pumpkin.tag == "Rotating") { Rotate rotate = pumpkin.AddComponent <Rotate> () as Rotate; Destroy(pumpkin, 10); } if (pumpkin.tag == "Shooting") { Bullet bullet = pumpkin.AddComponent <Bullet> () as Bullet; pumpkin.AddComponent <PumpkinClick>(); bullet.bulletPrefab = Resources.Load("HealthFullBlue") as GameObject; bullet.speed = -5; bullet.time = 6; } Hover.Instance.Deactivate(); this.clickedSelection = null; }
public void PickPumpkin(PumpkinSelection selection) { this.clickedSelection = selection; Hover.Instance.Activate(selection.Sprite); }