示例#1
0
 public void RemoveTackFromList(Tack p_tack)
 {
     if (p_tack != null)
     {
         TacksInObject.RemoveChecking(p_tack);
         _needCheckKinematic = true;
     }
 }
示例#2
0
 public void AddTackInList(Tack p_tack)
 {
     if (p_tack != null)
     {
         TacksInObject.AddChecking(p_tack);
         _needCheckKinematic = true;
     }
 }
示例#3
0
        public GameObject GetTackObjectWithIndex(int p_index, bool p_returnDefaultWhenOutOfBounds = true)
        {
            Tack       v_tack       = GetTackWithIndex(p_index, p_returnDefaultWhenOutOfBounds);
            GameObject v_tackObject = v_tack != null ? v_tack.gameObject : null;

            if (v_tackObject == null)
            {
                v_tackObject = this.gameObject;
            }
            return(v_tackObject);
        }
示例#4
0
        public Tack GetTackWithIndex(int p_index, bool p_returnDefaultWhenOutOfBounds = true)
        {
            Tack v_tack = null;

            if (p_index >= 0 && p_index < TacksInObject.Count)
            {
                v_tack = TacksInObject[p_index];
            }
            if (v_tack == null && p_returnDefaultWhenOutOfBounds)
            {
                foreach (Tack v_tackInList in TacksInObject)
                {
                    v_tack = v_tackInList;
                    if (v_tack != null)
                    {
                        break;
                    }
                }
            }
            return(v_tack);
        }
示例#5
0
        public int GetIndexOfTack(Tack p_tack, bool p_addThisTackIfNotAdded = true)
        {
            int v_returnIndex = -1;

            if (p_tack != null)
            {
                for (int i = 0; i < TacksInObject.Count; i++)
                {
                    Tack v_tackInObject = TacksInObject[i];
                    if (p_tack == v_tackInObject)
                    {
                        v_returnIndex = i;
                        break;
                    }
                }
                if (v_returnIndex == -1 && p_addThisTackIfNotAdded)
                {
                    TacksInObject.Add(p_tack);
                    v_returnIndex = TacksInObject.Count - 1;
                }
            }
            return(v_returnIndex);
        }