public SnakeTail(GameObject gameObj, BoardPoint target, BoardPoint position) { this.gameObject = gameObj; this.movements = new ObjMovements(this.gameObject, position); this.target = target; this.position = position; }
public Grower(GameObject obj) { BoardPointFactory pointFac = new BoardPointFactory(); this.position = pointFac.FromGameObjPosition(obj); this.movs = new ObjMovements(obj.transform, this.position); }
public SnakeTail(GameObject gameObj, BoardPoint position, DirectionEnum.Direction direction) { this.gameObject = gameObj; this.movements = new ObjMovements(this.gameObject.transform, position); this.position = position; this.direction = direction; }
public void Build(int iterator) { if (PoolManager.Instance.IfExist(iterator) == 0) // если постройки даного типа закончились { btnTxtCounter[iterator].text = Buildings[iterator].objCount + "/" + Buildings[iterator].objCount; return; } Storage.SetActive(false); Vector3 newPos = Camera.main.transform.position + new Vector3(5f, 0f, 5f); // позиция в которой появится постройка newPos.y = 0.5f; GameObject newBuilding = PoolManager.Instance.GetObject(iterator); newBuilding.transform.position = newPos; newBuilding.SetActive(true); newBuilding.GetComponentInChildren <ParticleSystem>().Play(); ObjMovements newBuildingParams = newBuilding.GetComponent <ObjMovements>(); newBuildingParams.arrayIndex = iterator; newBuildingParams.move = true; newBuildingParams.objSizeX = Buildings[iterator].objSizeX; newBuildingParams.objSizeZ = Buildings[iterator].objSizeZ; // Запись оставшегося кол-ва доступных построек btnTxtCounter[iterator].text = (Buildings[iterator].objCount - PoolManager.Instance.IfExist(iterator)) + "/" + Buildings[iterator].objCount; }
public SnakeTail Build(float x, float y, DirectionEnum.Direction direction) { GameObject obj = GameObject.Instantiate(prefab) as GameObject; BoardPoint pos = new BoardPoint(0, 0); ObjMovements movs = new ObjMovements(obj.transform, pos); movs.GoTo(x, y); return(new SnakeTail(obj, pos, direction)); }
public SnakeHead(GameObject gameObject) { BoardPointFactory pointFac = new BoardPointFactory(); this.position = pointFac.FromGameObjPosition(gameObject); this.gameObject = gameObject; this.direction = Direction.UP; this.movements = new ObjMovements(this.gameObject.transform, this.position); this.turns = new List <Direction>(); }