public GameObject SpawnOccupant(GameObject prefab, IntVector2 pos, bool overrideOccupied = false) { if (prefab == null || (Occuppied(pos) && !overrideOccupied)) { Debug.LogError("Error adding occupant!"); return(null); } GameObject instance = Instantiate(prefab, this.transform); instance.name = prefab.name; tiles[pos.x, pos.y].occupant = instance; instance.transform.position = (Vector3)pos; IntTransform mov = instance.GetComponent <IntTransform>(); if (mov) { mov.SetPos(pos); } PlayerController playerController = instance.GetComponent <PlayerController>(); if (playerController != null) { players.Add(playerController); } return(instance); }
void Awake() { intTransform = this.GetComponent <IntTransform>(); if (weapon) { weapon.OnEquip(this.gameObject); } }
public GameObject SpawnCollectable(GameObject prefab, IntVector2 pos) { if (prefab == null) { Debug.LogError("Error adding collectable"); return(null); } GameObject instance = Instantiate(prefab, this.transform); instance.name = prefab.name; instance.transform.position = (Vector3)pos; IntTransform mov = instance.GetComponent <IntTransform>(); if (mov) { mov.SetPos(pos); } return(instance); }
protected virtual void Awake() { _intTransform = new IntTransform(); }
public override bool Movable(IntTransform intTransform) { return(false); }
public Move(IntTransform intTransform, MapInfo mapInfo, IntVector direction) : base(intTransform, mapInfo) { _direction = direction; }
void Awake() { intTransform = this.GetComponent <IntTransform>(); movable = this.GetComponent <Movable>(); }
public PlayerInput Initialize(IntTransform intTransform, MapInfo mapInfo) { _intTransform = intTransform; _mapInfo = mapInfo; return(this); }
// Use this for initialization void Awake() { intTransform = this.GetComponent <IntTransform>(); OccupantManager.S.occupants[intTransform.position] = this.gameObject; OccupantManager.S.lowestPoint = Mathf.Min(OccupantManager.S.lowestPoint, intTransform.position.y); }
protected virtual void Awake() { intTransform = this.GetComponent <IntTransform>(); }
public override BaseActor Initialize(IntTransform intTransform, MapInfo mapInfo) { base.Initialize(intTransform, mapInfo); _selector = GetComponent <ClickSelector>(); return(this); }
public virtual BaseActor Initialize(IntTransform intTransform, MapInfo mapInfo) { MapInfo = mapInfo; IntTransform = intTransform; return(this); }
void Awake() { intTransform = this.GetComponent <IntTransform>(); }
public bool Movable(IntVector position, IntTransform intTransform) { var info = GetMapChipInfo(position); return(info.MapChip.Movable(intTransform)); }
protected BaseAction(IntTransform intTransform, MapInfo mapInfo) { MapInfo = mapInfo; IntTransform = intTransform; }
public abstract bool Movable(IntTransform intTransform);