Ejemplo n.º 1
0
    public void EnterCreature(GameObject creature)
    {
        m_InputHandler.ResetControls();
        gameObject.transform.SetParent(creature.transform);
        gameObject.SetActive(false);
        CreatureController cc = creature.GetComponent <CreatureController>();
        InputHandler       ih = creature.GetComponent <InputHandler>();
        AIBehaviour        ai = creature.GetComponent <AIBehaviour>();

        cc.SetSpirit(gameObject);
        cc.CalculateStats();
        ih.PlayerControlled = true;
        ai.ChangeState(ai.GetSpiritState);

        m_CharacterUI.UpdateBodyInfo();
    }
    public void Die()
    {
        m_Spirit.SetActive(true);
        m_Spirit.transform.position = transform.position + new Vector3(0, 2);
        m_Spirit.transform.parent   = null;

        m_CharacterUI.UpdateBodyInfo();

        m_InputHandler.PlayerControlled = false;
        m_InputHandler.ResetControls();

        m_AIBehaviour.ChangeState(m_AIBehaviour.GetIdleState);

        CalculateNormal();

        m_CameraBehaviour.SetTarget(m_Spirit);
    }