public void DoAction() { if (im.overlapEcastms.Count != 0) { if (im.overlapEcastms[0].active == true && !dm.IsPlaying()) { if (im.overlapEcastms[0].eventName == "frontStab") { dm.PlayFrontStab("frontStab", this, im.overlapEcastms[0].am); } else if (im.overlapEcastms[0].eventName == "openBox") { if (BattleManager.CheckAnglePlayer(ac.model, im.overlapEcastms[0].am.gameObject, 30)) { im.overlapEcastms[0].active = false; transform.position = im.overlapEcastms[0].am.transform.position + im.overlapEcastms[0].am.transform.TransformVector(im.overlapEcastms[0].offset); ac.model.transform.LookAt(im.overlapEcastms[0].am.transform, Vector3.up); dm.PlayFrontStab("openBox", this, im.overlapEcastms[0].am); } } else if (im.overlapEcastms[0].eventName == "leverUp") { if (BattleManager.CheckAnglePlayer(ac.model, im.overlapEcastms[0].am.gameObject, 30)) { im.overlapEcastms[0].active = false; transform.position = im.overlapEcastms[0].am.transform.position + im.overlapEcastms[0].am.transform.TransformVector(im.overlapEcastms[0].offset); ac.model.transform.LookAt(im.overlapEcastms[0].am.transform, Vector3.up); dm.PlayFrontStab("leverUp", this, im.overlapEcastms[0].am); } } } } }
public void DoAction() { if (im.overlapEcastms.Count != 0) { if (im.overlapEcastms[0].enventName == "StabTimeline") { if (BattleManager.CheckAnglePlayer(ac.model, im.overlapEcastms[0].am.ac.model, 15)) { ac.model.transform.LookAt(im.overlapEcastms[0].am.transform, Vector3.up); transform.position = new Vector3(im.targetTransform.position.x, transform.position.y, im.targetTransform.position.z) + im.targetTransform.forward; dm.PlayFrontStab("StabTimeline", this, im.overlapEcastms[0].am); } } } }
private void DoAction() { if (im.overlapEcastms.Count != 0) { if (im.overlapEcastms[0].active && !dm.IsPlaying()) { if (im.overlapEcastms[0].eventName == "frontStab") { if (BattleManager.CheckAnglePlayer(ac.model, im.overlapEcastms[0].am.gameObject, 90)) { var targetPos = im.overlapEcastms[0].am.gameObject.transform.position; transform.position = targetPos + im.overlapEcastms[0].transform.forward * im.overlapEcastms[0].offset; ac.SetLockForward(targetPos); dm.PlayFrontStab(this, im.overlapEcastms[0].am); } } else if (im.overlapEcastms[0].eventName == "openBox") { if (BattleManager.CheckAnglePlayer(ac.model, im.overlapEcastms[0].am.gameObject, 90)) { //im.overlapEcastms[0].active = false; var targetPos = im.overlapEcastms[0].am.gameObject.transform.position; transform.position = targetPos + im.overlapEcastms[0].transform.forward * im.overlapEcastms[0].offset; ac.SetLockForward(targetPos); dm.PlayOpenBox(this, im.overlapEcastms[0].am); } } else if (im.overlapEcastms[0].eventName == "lever") { if (BattleManager.CheckAnglePlayer(ac.model, im.overlapEcastms[0].am.gameObject, 90)) { //im.overlapEcastms[0].active = false; var targetPos = im.overlapEcastms[0].am.gameObject.transform.position; transform.position = targetPos + im.overlapEcastms[0].transform.forward * im.overlapEcastms[0].offset; ac.SetLockForward(targetPos); dm.PullLever(this, im.overlapEcastms[0].am); } } } } }
public void DoAction() { if (interactionManager.overlapEcastms.Count != 0) { var eventObj = interactionManager.overlapEcastms[0]; if (eventObj.active && !directorManager.IsPlaying) { if (eventObj.eventName == "frontStab") { directorManager.PlayFrontStab(this, eventObj.actorManager); } else if (eventObj.eventName == "openBox") { var target = eventObj.actorManager.transform; if (BattleManager.CheckAnglePlayer(actorController.Model, target.gameObject, 15)) { eventObj.active = false; transform.position = target.position + target.TransformVector(eventObj.offset); actorController.Model.transform.LookAt(target, Vector3.up); directorManager.PlayOpenBox(this, eventObj.actorManager); } } else if (eventObj.eventName == "leverUp") { var target = eventObj.actorManager.transform; if (BattleManager.CheckAnglePlayer(actorController.Model, target.gameObject, 15)) { eventObj.active = false; transform.position = target.position + target.TransformVector(eventObj.offset); actorController.Model.transform.LookAt(target, Vector3.up); directorManager.PlayLeverUp(this, eventObj.actorManager); } } } } }