Exemplo n.º 1
0
    public void InitializeForNewCharacter(int characterIndex)
    {
        this.characterIndex = characterIndex;
        charRootTransform   = characters[characterIndex];
        charRootTransform.GetComponentInChildren <AI>().enabled = false;
        animator          = charRootTransform.GetComponentInChildren <Animator>();
        animatorIKHandler = animator.gameObject.AddComponent <AnimatorIKHandler>();

        handsController             = charRootTransform.GetComponentInChildren <HandsController>();
        handsController.holdNotepad = true;

        head = charRootTransform.GetComponentInChildren <Head>();
        head.Possess();

        notepad      = charRootTransform.Find("Notepad").GetComponent <Notepad>();
        notepad.text = "";

        if (OnPlayerEvent != null)
        {
            OnPlayerEvent(PlayerEvent.Possess);
        }
    }
Exemplo n.º 2
0
    public void InitializeForNewCharacter( int characterIndex )
    {
        this.characterIndex = characterIndex;
        charRootTransform = characters[ characterIndex ];
        charRootTransform.GetComponentInChildren<AI>().enabled = false;
        animator = charRootTransform.GetComponentInChildren<Animator>();
        animatorIKHandler = animator.gameObject.AddComponent<AnimatorIKHandler>();

        handsController = charRootTransform.GetComponentInChildren<HandsController>();
            handsController.holdNotepad = true;

        head = charRootTransform.GetComponentInChildren<Head>();
            head.Possess();

        notepad = charRootTransform.Find("Notepad").GetComponent<Notepad>();
            notepad.text = "";

        if ( OnPlayerEvent != null )
            OnPlayerEvent ( PlayerEvent.Possess );
    }