public void SetLockTarget(int targetId)
        {
            int oldTargetId = 0;

            if (null != m_SelectedTarget)
            {
                oldTargetId = m_SelectedTarget.TargetId;
            }
            OnSelectedTargetChange(oldTargetId, targetId);
            EntityInfo target = GetEntityById(targetId);

            if (null != target)
            {
                m_SelectedTarget = new LockTargetInfo {
                    Target = target, TargetId = targetId
                };
                EntityInfo leader = GetEntityById(LeaderId);
                if (null != leader)
                {
                    AiStateInfo aiInfo = leader.GetAiStateInfo();
                    if (null != SelectedTarget)
                    {
                        aiInfo.Target = SelectedTarget.TargetId;
                    }
                }
            }
            else
            {
                m_SelectedTarget = null;
            }
        }
示例#2
0
 static public int get_Target(IntPtr l)
 {
     try {
         GameFramework.LockTargetInfo self = (GameFramework.LockTargetInfo)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.Target);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#3
0
 static public int constructor(IntPtr l)
 {
     try {
         GameFramework.LockTargetInfo o;
         o = new GameFramework.LockTargetInfo();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
示例#4
0
 static public int set_Target(IntPtr l)
 {
     try {
         GameFramework.LockTargetInfo self = (GameFramework.LockTargetInfo)checkSelf(l);
         GameFramework.EntityInfo     v;
         checkType(l, 2, out v);
         self.Target = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }