示例#1
0
 public void Follow(Transform trans)
 {
     if (!isFollowing && null != trans)
     {
         isFollowing = true;
         Follow3DBy2D.FollowTrans(itemGo, trans, Vector3.zero);
     }
 }
示例#2
0
        public Transform AddBar(int ownerId, Vector3 pos)
        {
            GameObject bar = CreateBar();

            Follow3DBy2D.FollowPos(bar, pos);
            bars.Add(ownerId, bar);
            return(bar.transform);
        }
示例#3
0
        public static void StopFollower(GameObject follower)
        {
            Follow3DBy2D comp = follower.GetComponent <Follow3DBy2D>();

            if (null != comp)
            {
                comp.StopFollow();
            }
        }
示例#4
0
 public void BarChangeFollower(int ownerId, Transform followTrans)
 {
     if (bars.ContainsKey(ownerId))
     {
         GameObject bar = bars[ownerId];
         if (null != bar)
         {
             Follow3DBy2D.FollowTrans(bar, followTrans, Vector3.zero);
         }
     }
 }
示例#5
0
 public void RemoveBar(int ownerId)
 {
     if (bars.ContainsKey(ownerId))
     {
         GameObject bar = bars[ownerId];
         Follow3DBy2D.StopFollower(bar);
         bar.SetActive(false);
         unUsed.Add(bar);
         bars.Remove(ownerId);
     }
 }
示例#6
0
 public void ReleaseItem()
 {
     if (null != itemGo)
     {
         if (isFollowing)
         {
             isFollowing = false;
             Follow3DBy2D.StopFollower(itemGo);
         }
         CachedClone.RemoveClone(itemGo, false);
         itemGo = null;
         item   = null;
     }
 }
示例#7
0
        public Transform AddBar(int ownerId, Transform followTrans, Vector3 followDelta)
        {
            GameObject bar = CreateBar();

            Follow3DBy2D.FollowTrans(bar, followTrans, followDelta);
            if (bars.ContainsKey(ownerId))
            {
                Debug.LogError("Repeat KEY!!!:" + ownerId);
            }
            if (!bars.ContainsKey(ownerId))
            {
                bars.Add(ownerId, bar);
            }
            return(bar.transform);
        }
示例#8
0
        public static Follow3DBy2D FollowTrans(GameObject follower, Transform follow_trans, Vector3 follow_delta)
        {
            Follow3DBy2D comp = follower.GetComponent <Follow3DBy2D>();

            if (null == comp)
            {
                comp = follower.AddComponent <Follow3DBy2D>();
            }
            comp.mFollowType = FollowType.FOLLOW_TRANS;
            comp.followTrans = follow_trans;
            comp.followDelta = follow_delta;
            comp.enabled     = true;
            comp.Init();
            comp.RefreshPos();
            return(comp);
        }
示例#9
0
        public static Follow3DBy2D FollowPos(GameObject follower, Vector3 follow_pos)
        {
            Follow3DBy2D comp = follower.GetComponent <Follow3DBy2D>();

            if (null == comp)
            {
                comp = follower.AddComponent <Follow3DBy2D>();
            }
            comp.mFollowType    = FollowType.FOLLOW_POINT;
            comp.followPosition = follow_pos;
            comp.followTrans    = null;
            comp.enabled        = true;
            comp.Init();
            comp.RefreshPos();
            return(comp);
        }
示例#10
0
 public void StopFollow()
 {
     Follow3DBy2D.StopFollower(CachedGo);
 }
示例#11
0
 public void Follow(Transform followee)
 {
     Follow3DBy2D.FollowTrans(CachedGo, followee, new Vector3(0, 0.5f, 0));
 }