private bool m_Jump;                          // the world-relative desired move direction, calculated from the camForward and user input.


    private void Start()
    {
        // get the transform of the main camera
        if (Camera.main != null)
        {
            m_Cam = Camera.main.transform;
        }
        else
        {
            Debug.LogWarning(
                "Warning: no main camera found. Third person character needs a Camera tagged \"MainCamera\", for camera-relative controls.", gameObject);
            // we use self-relative controls in this case, which probably isn't what the user wants, but hey, we warned them!
        }

        // get the third person character ( this should never be null due to require component )
        m_Character = GetComponent <ThirdPersonCharacter2>();
    }
示例#2
0
    int _selected = 0;                                         // 選択中の目標

    private void Start()
    {
        agent                = GetComponentInChildren <UnityEngine.AI.NavMeshAgent>();
        character            = GetComponent <ThirdPersonCharacter2>();
        agent.updateRotation = false;
        agent.updatePosition = true;
        agent.speed          = _agent_speed; // NavMeshで設定した値は上書きされる
        //agent.stoppingDistance = 1.0f;

        // 最初の目標を設定する
        if (_route_object != null)
        {
            set_next_target(0);
        }
        else
        {
            agent.SetDestination(agent.transform.position);
            character.Move2(Vector3.zero, 0);
        }
    }