Ejemplo n.º 1
0
    public void Awake()
    {
        statemachine  = gameObject.GetComponent <PlayerScriptStateMachine>();
        myRigidbody2D = GetComponent <Rigidbody2D>();

        _playerScript = GetComponent <PlayerScript>();
    }
    private void Awake()
    {
        GameObject leto = GameObject.FindGameObjectWithTag("Leto");

        playerScript = leto.GetComponent <PlayerScript>();
        playerStats  = leto.GetComponent <PlayerStats>();
        statemachine = leto.GetComponent <PlayerScriptStateMachine>();

        if (playerScript == null)
        {
            Debug.Log("Player Script Serializable - Leto's Script is missing?");
        }

        if (playerStats == null)
        {
            Debug.Log("Player Script Serializable - Leto's Stats are missing?");
        }
    }