Example #1
0
        public void Update(StateContex contex)
        {
            contex.weapon = bag.GetNowWeapon();
            soldierState  = soldierState.NextState(_this, animatorHandler, contex);

            contex.characterType = charactType;
            contex.weapon.Update(_this, animatorHandler, contex);
        }
Example #2
0
        private void SetState(SoldierStateBase state)
        {
            soldierState = state;

            contex.Clear();
            contex.weapon = bag.GetNowWeapon();
            soldierState.Enter(_this, animatorHandler, contex);
        }
Example #3
0
 public void Clear()
 {
     weapon   = null;
     preState = null;
     for (int i = 0; i < contexes.Length; i++)
     {
         contexes[i] = -1;
     }
 }
Example #4
0
        public Soldier(GameObject soldier,
                       AnimatorHandler animatorHandler,
                       SoldierStateBase state,
                       CharacterType charactType,
                       int userID,
                       int roomID)
        {
            this._this           = soldier;
            this.animatorHandler = animatorHandler;
            this.charactType     = charactType;
            this.userID          = userID;
            this.roomID          = roomID;

            isAlive = true;

            bag = new WeaponBag();

            SetWeaponAndState(bag.GetNowWeapon(), bag.GetNowWeaponIndex(), state);

            roleState = new RoleState(false);

            EventMgr.Instance.AddEventListener(EventName.PLAYER_CHANGE_WEAPON + "#" + userID.ToString(), ChangeWeaponCmd);
        }
Example #5
0
 public void SetWeaponAndState(WeaponBase weapon, int pos, SoldierStateBase state)
 {
     SetWeapon(weapon, pos, charactType);
     SetState(state);
 }