Пример #1
0
        // Update is called once per frame
        void Update()
        {
            MiroModelV1 model =
                CellObjCtrlUtils.GetMiroModelFromCell(_CCtrl);

            if (model == null)
            {
                _bON = false;
            }
            else
            {
                int movePwr = model.GetMovePwr();
                _bON = (movePwr > 0);
            }

            CircleCollider2D cld = GetComponent <CircleCollider2D> ();

            cld.enabled = _bON;

            if (_bONPrev != _bON)
            {
                _bONChanged.Invoke();
                _bONPrev = _bON;
            }
        }
Пример #2
0
 public int GetMovePwr()
 {
     if (_TgtObj != null)
     {
         MiroModelV1 model =
             CellObjCtrlUtils.GetMiroModelFromCell(this);
         int movePwr = model.GetMovePwr();
         return(movePwr);
     }
     else
     {
         return(-1);
     }
 }
Пример #3
0
        public void MoveFwd(bool bUseMovePwr = false)
        {
            bool bMove = true;

            if (bUseMovePwr)
            {
                MiroModelV1 model = CellObjCtrlUtils.GetMiroModelFromCell(this);
                if (model != null)
                {
                    int movePwr = model.GetMovePwr();
                    bMove = (movePwr > 0);
                }
            }
            if (bMove && CanMove(_Dir))
            {
                ExhaustMovePower();
                MoveInDir(_Dir);
            }
        }