Beispiel #1
0
 public void DoAction()
 {
     if (intMgr.lst_ovrlapEvnCstr.Count != 0)
     {
         if (intMgr.lst_ovrlapEvnCstr[0].active == true)
         {
             dirMgr.victim = intMgr.lst_ovrlapEvnCstr[0].actMgr;
             if (intMgr.lst_ovrlapEvnCstr[0].eventName == "frontStab")
             {
                 dirMgr.PlayFrontStab("frontStab", this, intMgr.lst_ovrlapEvnCstr[0].actMgr);
             }
             else if (intMgr.lst_ovrlapEvnCstr[0].eventName == "openBox")
             {
                 if (BattleMgr.CheckAnglePlayer(actCtrl.model, intMgr.lst_ovrlapEvnCstr[0].actMgr.gameObject, 30))
                 {
                     intMgr.lst_ovrlapEvnCstr[0].active = false;
                     transform.position = intMgr.lst_ovrlapEvnCstr[0].actMgr.transform.position + intMgr.lst_ovrlapEvnCstr[0].actMgr.transform.TransformVector(intMgr.lst_ovrlapEvnCstr[0].offset);
                     actCtrl.model.transform.LookAt(intMgr.lst_ovrlapEvnCstr[0].actMgr.transform, Vector3.up);
                     dirMgr.PlayFrontStab("openBox", this, intMgr.lst_ovrlapEvnCstr[0].actMgr);
                 }
             }
             else if (intMgr.lst_ovrlapEvnCstr[0].eventName == "leverUp")
             {
                 if (BattleMgr.CheckAnglePlayer(actCtrl.model, intMgr.lst_ovrlapEvnCstr[0].actMgr.gameObject, 180))
                 {
                     //intMgr.lst_ovrlapEvnCstr[0].active = false;
                     transform.position = intMgr.lst_ovrlapEvnCstr[0].actMgr.transform.position + intMgr.lst_ovrlapEvnCstr[0].actMgr.transform.TransformVector(intMgr.lst_ovrlapEvnCstr[0].offset);
                     actCtrl.model.transform.LookAt(intMgr.lst_ovrlapEvnCstr[0].actMgr.transform, Vector3.up);
                     dirMgr.PlayFrontStab("leverUp", this, intMgr.lst_ovrlapEvnCstr[0].actMgr);
                 }
             }
         }
     }
 }