public IEnumerator StartConversation(AbstractEntity argEntity) { if (argEntity is Speaker) { yield return StartCoroutine(argEntity.Activate(Speaker)); // Disable Controllers if(ThirdPersonController != null) ThirdPersonController.enabled = false; ThirdPersonCamera.offset += new Vector3(1, 1, 0) * 0.25f; ThirdPersonCamera.distance -= 0.5f; ThirdPersonCamera.height += 0.5f; StartCoroutine(argEntity.RotateTowards(Speaker.Transform.position - argEntity.Transform.position, 2)); StartCoroutine(Speaker.RotateTowards(argEntity.Transform.position - Speaker.Transform.position, 2)); // Execute Commands Dialogue dialogue = (argEntity as Speaker).GetDialogue(Speaker); yield return StartCoroutine(Read(dialogue)); } }
private IEnumerator PossessLiving(AbstractEntity argEntity) { StartCoroutine(argEntity.Activate(Speaker)); /// Disable Control // Ghost.DisablePlayerControl(); Ghost.ThirdPersonController.enabled = false; if (argEntity is HumanScript) (argEntity as HumanScript).HideMood(); /// Animate Rotation StartCoroutine(argEntity.RotateTowards(Ghost.Transform.position - argEntity.Transform.position, 2)); StartCoroutine(Ghost.RotateTowards(argEntity.Transform.position - Ghost.Transform.position, 2)); //TODO: REMOVE, SHORTCUT if (Input.GetKey(KeyCode.Tab)) { // Animate Pull yield return new WaitForSeconds(0.3f); // Wait for Rotation Complete Ghost.animation.CrossFade(AnimationResources.PossWrongInput); //TODO: DROP ROPES HERE // Rotate Target yield return new WaitForSeconds(0.3f); argEntity.animation.CrossFade(AnimationResources.PossComplete); yield return new WaitForSeconds(0.1f); yield return StartCoroutine(Target.RotateTowards(Ghost.Transform.position - Target.Transform.position, 2)); // Move Back // yield return StartCoroutine(Ghost.MoveTo(Ghost.Transform.position - (Ghost.Transform.forward * 0.3f) + (Ghost.Transform.up * 0.3f), 1)); // Jump Into Target Ghost.Animation.CrossFade(AnimationResources.PossComplete); //argEntity.animation.CrossFade(AnimationResources.PossComplete); } else yield return StartCoroutine(PossessionStruggle(argEntity as AbstractLivingBeing)); }