/// <summary> /// Zmeni obsazeni tilu na true, protoze na nej byl pridat generator /// </summary> /// <param name="o">Generator, ktery byl na tile umisten</param> public void ChangeOccupation(PTSObject o) { IsOccupied = true; ObjectOnTile = o; /* * ObjectOnTile.transform.position = new Vector3(Position.x, Height, Position.y); * ObjectOnTile.transform.rotation = new Quaternion(0, -180, 0, 0); */ }
public Tile(Vector3 pos, PTSObject o) { Vector3Int p = Vector3Int.FloorToInt(pos); Position = new Vector2Int(p.x, p.z); Height = pos.y; ObjectOnTile = o; IsOccupied = true; IsAccessable = true; }
protected override void Start() { base.Start(); Level.Instance.AddActivatorToList(this); TargetReferences = new List <PTSObject>(); if (goTargets != null) { foreach (GameObject go in goTargets) { PTSObject[] targets; if (go.transform.parent != null) { targets = go.transform.parent.GetComponentsInChildren <PTSObject>(); } else { targets = new PTSObject[] { go.GetComponent <PTSObject>() } }; foreach (PTSObject o in targets) { if (o.ItemType.Equals(ItemType) || o.ItemType.Equals(TimelineObject.Both)) { TargetReferences.Add(o); continue; } } } } if (IsActivated) { Activate(); } }