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); } } } } }
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 (dm.IsPlaying()) { return; } foreach (var ecastm in im.overlapEcastms) { if (!ecastm.active) { continue; } if (ac.model.transform.CheckAngleSelf(ecastm.am.transform, 30.0f)) { //transform.position = ecastm.transform.position + ecastm.am.transform.TransformVector(ecastm.offset); ac.model.transform.forward -= ecastm.am.transform.forward; //ac.model.transform.LookAt(ecastm.am.transform, Vector3.up); ecastm.active = false; dm.Play(ecastm.eventType, this, ecastm.am); } } }