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); } }
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 ); }