void InitRed() { DDRed.poolOn = new List <DDRed>(); DDRed.poolOff = new List <DDRed>(); for (int i = 0; i < 2; ++i) { for (int j = 0; j < 5; ++j) { DDRed red = DDRed.CreateFromPool(); red.transform.localPosition = new Vector3(22 + i * 4, 10 + j * 4, 0) * 16; wallsInit[j * 64 + i] = true; } } }
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; } } }