Beispiel #1
0
    public bool AddAvatarPedestalsToTrigger(int i)
    {
        if (ObjectsWithTrigger.Count == 0)
        {
            return(true);
        }

        if (ObjectsWithTrigger.Count == 1)
        {
            return(AddAvatarPedestalsToTrigger(ObjectsWithTrigger[0]));
        }

        List <GameObject> MyAvatarPedestals = new List <GameObject>();
        int    m = 0;
        bool   b = true;
        string S = "";

        for (int l = 0; l < PendingAvatarPedestals.Count; l++)
        {
            if (l > 0 && l % i == 0)
            {
                if (m < ObjectsWithTrigger.Count - 1)
                {
                    if (!AddAvatarPedestalsToTrigger(ObjectsWithTrigger[m], MyAvatarPedestals))
                    {
                        b = false;
                    }

                    if (CustomMessage != "")
                    {
                        S = CustomMessage;
                    }

                    MyAvatarPedestals = new List <GameObject>();
                    m++;
                }
            }

            MyAvatarPedestals.Add(PendingAvatarPedestals[l]);
        }

        if (MyAvatarPedestals.Count > 0 && ObjectsWithTrigger.Count >= m)
        {
            if (!AddAvatarPedestalsToTrigger(ObjectsWithTrigger[m], MyAvatarPedestals))
            {
                b = false;
            }

            if (CustomMessage != "")
            {
                S = CustomMessage;
            }
        }

        if (S != "")
        {
            CustomMessage = S;
        }

        return(b);
    }
Beispiel #2
0
    public bool AddAvatarPedestalsToTrigger_CreateTriggers(int i, int n)
    {
        List <GameObject> MyAvatarPedestals = new List <GameObject>();
        int        m = 0, o = 0;
        bool       b = true;
        string     S = "";
        GameObject MyObjectWithTrigger;

        for (int l = 0; l < PendingAvatarPedestals.Count; l++)
        {
            if (l > 0 && l % i == 0)
            {
                if (l % n == 0)
                {
                    m = 0;
                    o++;
                }

                MyObjectWithTrigger = CreateObjectWithTrigger(m, o);

                if (CustomMessage != "")
                {
                    S = CustomMessage;
                }

                if (MyObjectWithTrigger != null)
                {
                    if (!AddAvatarPedestalsToTrigger(MyObjectWithTrigger, MyAvatarPedestals))
                    {
                        b = false;
                    }

                    if (CustomMessage != "")
                    {
                        S = CustomMessage;
                    }

                    MyAvatarPedestals = new List <GameObject>();
                    m++;
                }
                else
                {
                    b = false;
                    MyAvatarPedestals = new List <GameObject>();
                    break;
                }
            }

            MyAvatarPedestals.Add(PendingAvatarPedestals[l]);
        }

        if (MyAvatarPedestals.Count > 0)
        {
            MyObjectWithTrigger = CreateObjectWithTrigger(m, o);

            if (CustomMessage != "")
            {
                S = CustomMessage;
            }

            if (MyObjectWithTrigger != null)
            {
                if (!AddAvatarPedestalsToTrigger(MyObjectWithTrigger, MyAvatarPedestals))
                {
                    b = false;
                }

                if (CustomMessage != "")
                {
                    S = CustomMessage;
                }
            }
            else
            {
                b = false;
            }
        }

        if (S != "")
        {
            CustomMessage = S;
        }

        return(b);
    }