Ejemplo n.º 1
0
        private void SetGroup()
        {
            slaveList = new List <AnimateOnSunRise>();

            bool masterFound = false;

            foreach (StaticInstance sInstance in staticInstance.groupCenter.childInstances)
            {
                if (sInstance == staticInstance)
                {
                    continue;
                }
                foreach (var module in sInstance.mesh.GetComponents <AnimateOnSunRise>())
                {
                    if (module.isMaster)
                    {
                        master      = module;
                        masterFound = true;
                        isMaster    = false;
                        break;
                    }
                    else
                    {
                        slaveList.Add(module);
                    }
                }
            }

            if (!masterFound)
            {
                master   = this;
                isMaster = true;
            }
        }
Ejemplo n.º 2
0
        private void SetGroup()
        {
            slaveList = new List <AnimateOnSunRise> ();

            if (staticInstance.Group == "Ungrouped")
            {
                master   = this;
                isMaster = true;
                return;
            }

            bool findMaster = false;

            foreach (StaticInstance sInstance in StaticDatabase.GetAllStatics())
            {
                if (sInstance != staticInstance)
                {
                    if (sInstance.Group == staticInstance.Group)
                    {
                        AnimateOnSunRise module = sInstance.gameObject.GetComponentInChildren <AnimateOnSunRise> ();
                        if (module != null)
                        {
                            if (module.isMaster)
                            {
                                master     = module;
                                findMaster = true;
                                isMaster   = false;
                                break;
                            }
                            else
                            {
                                slaveList.Add(module);
                            }
                        }
                    }
                }
            }

            if (!findMaster)
            {
                master   = this;
                isMaster = true;
            }
        }