Exemple #1
0
 protected override void OnExecute(InteractiveObj self, InteractiveObj target)
 {
     if (target.IsEnemy(self.Camp))
     {
         target.Camp = self.Camp;
         SceneObjHeadInfo info = target.UIHeadInfo;
         if (info)
         {
             if (self.Camp == Common.MyselfCamp)
             {
                 info.txtBlood.color = Color.green;
                 info.sldBlood.fillRect.GetComponent <UnityEngine.UI.Graphic>().color = Color.green;
                 DrawAttackRange draw = target.GetComponent <DrawAttackRange>();
                 if (draw)
                 {
                     draw.bNeedUpdate = false;
                 }
                 LineRenderer line = target.GetComponent <LineRenderer>();
                 if (line)
                 {
                     line.enabled = false;
                 }
             }
             else
             {
                 info.txtBlood.color = Color.red;
                 info.sldBlood.fillRect.GetComponent <UnityEngine.UI.Graphic>().color = Color.red;
             }
         }
         self.DoDamage(new Damage(WorldSetting.Effect.Dark, 5), WorldInteractObj.Instance);
     }
 }
Exemple #2
0
 protected override void OnInit(InteractiveObj obj)
 {
     MasterChara = obj as Character;
     Follow      = obj.GetComponent <CharacterFollow>();
     MasterChara.WillNotBeFind = true;
     VedioPlayer.OnVedioFinished.AddListener(() =>
     {
         _start = true;
         MasterChara.Role.PlayAction("Hello", 0);
         Vector3 pos = ThirdPersonPlayer.Instance.transform.position;
         pos.y       = MasterChara.transform.position.y;
         MasterChara.transform.LookAt(pos);
     });
 }