示例#1
0
 void move(CubeMark NeedNum)
 {//移动脚本
     //实现移动
     if (NeedNum.Ismove == false)
     {
         GameObject t      = Greed.Greedys(NeedNum);
         GameObject Moveto = t;//通过移动位置判断脚本得到移动位置
         if (Moveto.GetComponent <CubeMark>().Isbulled == false && Moveto && NeedNum.Issm)
         {
             NeedNum.Issm.transform.DOMove((Moveto.transform.position - NeedNum.gameObject.transform.position), 0.2f).SetEase(Ease.Linear).SetRelative();
             if (NeedNum.IsbigMO)
             {
                 NeedNum.IsbigMO.transform.DOMove((Moveto.transform.position - NeedNum.gameObject.transform.position), 0.2f).SetEase(Ease.Linear).SetRelative();
             }//小兵以及英雄单位的移动实现
             SetCube(Moveto.GetComponent <CubeMark>(), NeedNum);//移动后各自地板属性变换
             GetNull(NeedNum);//原地板归零
         }
         else
         {
             Moveto = NeedNum.gameObject;                    //不移动
         }
         Needscontrol.Remove(NeedNum);                       //移除原已存在对象
         Needscontrol.Add(Moveto.GetComponent <CubeMark>()); //添加移动后的对象
         AttackJudge(Moveto.GetComponent <CubeMark>());      //攻击选择
     }
 }