void DropMine() { if (CubeCounter.instance.HasSome()) { DDYellow newMine = DDYellow.CreateFromPool(); CubeCounter.instance.Drop(); newMine.transform.localPosition = new Vector3(DDPlayer.instance.nextX * 16, DDPlayer.instance.nextY * 16, 0); } else { SoundPool.NoBomb(); } }
public void OnPlaceOnMap() { if (active) { Vector3 target; target.x = Mathf.FloorToInt(((Input.mousePosition.x - Screen.width / 2) / DDMapCreator.instance.transform.lossyScale.x - DDMapCreator.instance.transform.localPosition.x) / 16); target.y = Mathf.FloorToInt(((Input.mousePosition.y - Screen.height / 2) / DDMapCreator.instance.transform.lossyScale.x - DDMapCreator.instance.transform.localPosition.y) / 16); target.z = 0; if (redSelected == true) { DDRed newFoe = DDRed.CreateFromPool(); newFoe.transform.localPosition = target * 16; } if (redSelected == false) { DDYellow newTrap = DDYellow.CreateFromPool(); newTrap.transform.localPosition = target * 16; } } }