Exemplo n.º 1
0
        private void Start()
        {
            _inputStates = new Queue <Input.State>();

            _cameraMouseAim = UnityEngine.Camera.main.GetComponent <MouseAim>();
            _cameraAimPoint = UnityEngine.Camera.main.GetComponent <AimPoint>();

            _characterInput    = GetComponent <InputManager>();
            _characterMovement = GetComponent <Movement>();
            _characterRotation = GetComponent <Rotation>();
        }
Exemplo n.º 2
0
    public void Initialize(GameObject character)
    {
        m_animator = character.GetComponent <Animator>();

        AimPoint point = character.GetComponentInChildren <AimPoint>();

        if (!point)
        {
            GameObject newPoint = new GameObject("AimPoint");
            point = newPoint.AddComponent <AimPoint>();
            newPoint.transform.parent        = character.transform;
            newPoint.transform.localPosition = new Vector3(0.0f, 0.5f, 0.0f);
        }

        m_aimPoint = point.transform;
    }
Exemplo n.º 3
0
    private void InitializeAimPoint(GameObject character)
    {
        if (m_aimPoint != null)
        {
            return;
        }

        AimPoint point = character.GetComponentInChildren <AimPoint>();

        if (!point)
        {
            GameObject newPoint = new GameObject("AimPoint");
            point = newPoint.AddComponent <AimPoint>();
            newPoint.transform.parent        = character.transform;
            newPoint.transform.localPosition = new Vector3(0.0f, 0.5f, 0.0f);
        }

        m_aimPoint = point.transform;
    }
Exemplo n.º 4
0
    protected Vector3 LookDirection;            // 캐릭터 시선방향

    //Use this for initialization
    void Awake()
    {
        Joystick   = FindObjectOfType <FixedJoystick>();   // 왼쪽 조이스틱 스크립트 접근
        TouchField = FindObjectOfType <FixedTouchField>(); // 터치화면 스크립트 접근
        ButtonA    = FindObjectOfType <FixedButtonA>();    // 공격버튼 스크립트 접근
        ButtonB    = FindObjectOfType <FixedButtonB>();    // 점프버튼 스크립트 접근
        ButtonR    = FindObjectOfType <FixedButtonR>();    // 달리기/ONOFF 스크립트 접근
        ButtonX    = FindObjectOfType <FixedButtonX>();    // 줍기버튼접근
        ButtonDrop = FindObjectOfType <FixedButtonDrop>(); // 던지기 버튼 접근
        ButtonAim  = FindObjectOfType <FixedButtonAim>();  // 던지기 버튼 접근
        AimPoint   = FindObjectOfType <AimPoint>();        //조준점

        ButtonAim.gameObject.SetActive(false);
        AimPoint.gameObject.SetActive(false);


        ButtonWalk = FindObjectOfType <ButtonWalk>();
        Player     = GetComponent <Player>(); // 플레이어 스크립트 접근
        buttonWalk = GameObject.Find("Joystick/FixedJoystick/ButtonWalk");
    }
Exemplo n.º 5
0
 private void Awake()
 {
     cameraAim = UnityEngine.Camera.main.GetComponent <AimPoint>();
 }