예제 #1
0
파일: Level.cs 프로젝트: TBartl/NecroClone
    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);
    }
예제 #2
0
 void Awake()
 {
     intTransform = this.GetComponent <IntTransform>();
     if (weapon)
     {
         weapon.OnEquip(this.gameObject);
     }
 }
예제 #3
0
파일: Level.cs 프로젝트: TBartl/NecroClone
    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);
    }
예제 #4
0
 protected virtual void Awake()
 {
     _intTransform = new IntTransform();
 }
예제 #5
0
파일: Wall.cs 프로젝트: snowhork/dungeon
 public override bool Movable(IntTransform intTransform)
 {
     return(false);
 }
예제 #6
0
파일: Move.cs 프로젝트: snowhork/dungeon
 public Move(IntTransform intTransform, MapInfo mapInfo, IntVector direction) : base(intTransform, mapInfo)
 {
     _direction = direction;
 }
예제 #7
0
파일: Player.cs 프로젝트: TBartl/BabyBounce
 void Awake()
 {
     intTransform = this.GetComponent <IntTransform>();
     movable      = this.GetComponent <Movable>();
 }
예제 #8
0
 public PlayerInput Initialize(IntTransform intTransform, MapInfo mapInfo)
 {
     _intTransform = intTransform;
     _mapInfo      = mapInfo;
     return(this);
 }
예제 #9
0
 // 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);
 }
예제 #10
0
 protected virtual void Awake()
 {
     intTransform = this.GetComponent <IntTransform>();
 }
예제 #11
0
 public override BaseActor Initialize(IntTransform intTransform, MapInfo mapInfo)
 {
     base.Initialize(intTransform, mapInfo);
     _selector = GetComponent <ClickSelector>();
     return(this);
 }
예제 #12
0
 public virtual BaseActor Initialize(IntTransform intTransform, MapInfo mapInfo)
 {
     MapInfo      = mapInfo;
     IntTransform = intTransform;
     return(this);
 }
예제 #13
0
 void Awake()
 {
     intTransform = this.GetComponent <IntTransform>();
 }
예제 #14
0
        public bool Movable(IntVector position, IntTransform intTransform)
        {
            var info = GetMapChipInfo(position);

            return(info.MapChip.Movable(intTransform));
        }
예제 #15
0
 protected BaseAction(IntTransform intTransform, MapInfo mapInfo)
 {
     MapInfo      = mapInfo;
     IntTransform = intTransform;
 }
예제 #16
0
 public abstract bool Movable(IntTransform intTransform);