Ejemplo n.º 1
0
    private void Start()
    {
        fadeCanvas      = GameManager.fadeCanvas.gameObject;
        textCanvas      = FrontSceneManager.textCanvas;
        eventCanvas     = FrontSceneManager.eventCanvas.canvas;
        playerRigidbody = GetComponent <Rigidbody>();
        isStop          = false;
        // diaryFlag = false;
        // tvFlag = false;
        moving = false;

        // 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 <ThirdCharacter>();
        screenSize        = new Vector2Int(Screen.width, Screen.height);
        maxTouchDistance *= screenSize.x;
    }
    /// <summary>
    /// Create an instance of this class function
    /// </summary>
    private ThirdCharacter()
    {
        if (_instance != null)
        {
            return;
        }

        _instance = this;
    }