示例#1
0
    // Update is called once per frame
    void Update()
    {
        if (eState.DEATH != _stateType)
        {
            _characterModule.UpdateAI();

            UpdateState();
            UpdateMove();
        }
    }
示例#2
0
    // Update is called once per frame
    void Update()
    {
        if (eState.DEATH != _stateType)
        {
            _characterModule.UpdateAI();

            /*
             * // Input 처리
             * if(true == _isPlayer)
             * {
             *  if(true == Input.GetMouseButtonUp(0))   // 유니티에서 마우스 입력 처리 방식
             *  {
             *      Vector2 clickPos = Input.mousePosition;
             *
             *      // 클릭한 화면좌표와 대응되는 월드 좌표 알아내야함.
             *      // Raycast 사용
             *      Ray ray = Camera.main.ScreenPointToRay(clickPos);
             *      RaycastHit hitInfo;
             *      if(true == Physics.Raycast(ray, out hitInfo, 100.0f, 1 << LayerMask.NameToLayer("Ground")))
             *      {
             *          Vector3 destPos = hitInfo.point;
             *          SetDestination(destPos);
             *          ChangeState(Character.eState.WALK);
             *      }
             *
             *  }
             *
             *
             * }
             */

            UpdateState();
            UpdateMove();
            UpdateDeath();
        }
    }