Ejemplo n.º 1
0
        void UpdateSelectionOptions()
        {
            Loading             = true;
            SelectedGameObjects = new List <GameObject>();

            for (int i = 0; i < SelectionManager.Current.Selection.Ids.Count; i++)
            {
                SelectedGameObjects.Add(SelectionManager.Current.AffectedGameObjects[SelectionManager.Current.Selection.Ids[i]]);
            }

            for (int s = 0; s < SelectionManager.Current.SymetrySelection.Length; s++)
            {
                for (int i = 0; i < SelectionManager.Current.Selection.Ids.Count; i++)
                {
                    SelectedGameObjects.Add(SelectionManager.Current.AffectedGameObjects[SelectionManager.Current.Selection.Ids[i]]);
                }
            }

            Count = SelectedGameObjects.Count;
            if (Count == 0)
            {
                None.SetActive(true);
                Mix.SetActive(false);
                MarkerListControler.UpdateList();
                return;
            }


            None.SetActive(false);
            Mix.SetActive(true);

            bool AllowName = SelectionManager.Current.Selection.Ids.Count == 1;

            if (AllowName)
            {
                ReadNameMarker();
            }


            AllowConnect        = true;
            AllowCamera         = true;
            AllowSize           = true;
            AllowAmount         = true;
            AllowEffectTemplate = true;
            AllowClouds         = true;
            AllowWeather        = true;

            bool[] CheckedTypes = new bool[(int)SaveLua.Marker.MarkerTypes.Count];

            SaveLua.Marker Mr;

            for (int i = 0; i < Count; i++)            // Search for allowed
            {
                Mr = SelectedGameObjects[i].GetComponent <MarkerObject>().Owner;

                if (!CheckedTypes[(int)Mr.MarkerType])
                {
                    CheckedTypes[(int)Mr.MarkerType] = true;

                    if (AllowConnect)
                    {
                        AllowConnect = Mr.AllowByType(SaveLua.Marker.KEY_ADJACENTTO);
                    }
                    if (AllowCamera)
                    {
                        AllowCamera = Mr.AllowByType(SaveLua.Marker.KEY_CANSETCAMERA);
                    }
                    if (AllowSize)
                    {
                        AllowSize = Mr.AllowByType(SaveLua.Marker.KEY_SIZE);
                    }
                    if (AllowAmount)
                    {
                        AllowAmount = Mr.AllowByType(SaveLua.Marker.KEY_AMOUNT);
                    }
                    if (AllowEffectTemplate)
                    {
                        AllowEffectTemplate = Mr.AllowByType(SaveLua.Marker.KEY_EFFECTTEMPLATE);
                    }
                    if (AllowClouds)
                    {
                        AllowClouds = Mr.AllowByType(SaveLua.Marker.KEY_CLOUDCOUNT);
                    }
                    if (AllowWeather)
                    {
                        AllowWeather = Mr.AllowByType(SaveLua.Marker.KEY_WEATHERDRIFTDIRECTION);
                    }

                    if (!AllowConnect && !AllowCamera && !AllowSize && !AllowAmount && !AllowEffectTemplate && !AllowClouds && !AllowWeather)
                    {
                        break;
                    }
                }
            }

            Mr = null;

            NameInput.SetActive(AllowName);

            Connect.SetActive(AllowConnect);

            CameraZoom.SetActive(AllowCamera);
            SetCamera.SetActive(AllowCamera);
            SyncCamera.SetActive(AllowCamera);
            ViewCamera.SetActive(AllowCamera);
            AlignCamera.SetActive(AllowCamera);

            Size.gameObject.SetActive(AllowSize);
            Amount.gameObject.SetActive(AllowAmount);
            Scale.gameObject.SetActive(false);
            EffectTemplate.gameObject.SetActive(AllowEffectTemplate);

            CloudCount.gameObject.SetActive(AllowClouds);
            CloudCountRange.gameObject.SetActive(AllowClouds);
            CloudEmitterScale.gameObject.SetActive(AllowClouds);
            CloudEmitterScaleRange.gameObject.SetActive(AllowClouds);
            CloudHeight.gameObject.SetActive(AllowClouds);
            CloudHeightRange.gameObject.SetActive(AllowClouds);
            CloudSpread.gameObject.SetActive(AllowClouds);
            CloudSpawnChance.gameObject.SetActive(AllowClouds);
            CloudForceType.gameObject.SetActive(AllowClouds);

            WeatherDriftDirection.gameObject.SetActive(AllowWeather);
            MapStyle.gameObject.SetActive(AllowWeather);
            WeatherType01.gameObject.SetActive(AllowWeather);
            WeatherType02.gameObject.SetActive(AllowWeather);
            WeatherType03.gameObject.SetActive(AllowWeather);
            WeatherType04.gameObject.SetActive(AllowWeather);
            WeatherType01Chance.gameObject.SetActive(AllowWeather);
            WeatherType02Chance.gameObject.SetActive(AllowWeather);
            WeatherType03Chance.gameObject.SetActive(AllowWeather);
            WeatherType04Chance.gameObject.SetActive(AllowWeather);

            ReadTypeMarker();

            if (AllowCamera)
            {
                ReadCameraMarker();
            }
            if (AllowSize)
            {
                ReadSizeMarker();
            }
            if (AllowAmount)
            {
                ReadAmountMarker();
            }

            if (AllowConnect)
            {
                ReadAdiacent();
            }
            else
            {
                Markers.MarkerConnected.Clear();
            }

            if (AllowClouds)
            {
                ReadClouds();
            }
            if (AllowWeather)
            {
                ReadWeather();
            }

            MarkerListControler.UpdateList();

            Loading = false;
        }
Ejemplo n.º 2
0
        void UpdateSelectionOptions()
        {
            Loading             = true;
            SelectedGameObjects = new List <GameObject>();

            for (int i = 0; i < SelectionManager.Current.Selection.Ids.Count; i++)
            {
                SelectedGameObjects.Add(SelectionManager.Current.AffectedGameObjects[SelectionManager.Current.Selection.Ids[i]]);
            }

            for (int s = 0; s < SelectionManager.Current.SymetrySelection.Length; s++)
            {
                for (int i = 0; i < SelectionManager.Current.Selection.Ids.Count; i++)
                {
                    SelectedGameObjects.Add(SelectionManager.Current.AffectedGameObjects[SelectionManager.Current.Selection.Ids[i]]);
                }
            }

            Count = SelectedGameObjects.Count;
            if (Count == 0)
            {
                None.SetActive(true);
                Mix.SetActive(false);
                MarkerListControler.UpdateList();
                return;
            }


            None.SetActive(false);
            Mix.SetActive(true);

            bool AllowName = SelectionManager.Current.Selection.Ids.Count == 1;

            if (AllowName)
            {
                ReadNameMarker();
            }


            AllowConnect = true;
            AllowCamera  = true;
            AllowSize    = true;
            AllowAmount  = true;


            bool[] CheckedTypes = new bool[(int)SaveLua.Marker.MarkerTypes.Count];

            SaveLua.Marker Mr;

            for (int i = 0; i < Count; i++)            // Search for allowed
            {
                Mr = SelectedGameObjects[i].GetComponent <MarkerObject>().Owner;

                if (!CheckedTypes[(int)Mr.MarkerType])
                {
                    CheckedTypes[(int)Mr.MarkerType] = true;

                    if (AllowConnect)
                    {
                        AllowConnect = Mr.AllowByType(SaveLua.Marker.KEY_ADJACENTTO);
                    }

                    if (AllowCamera)
                    {
                        AllowCamera = Mr.AllowByType(SaveLua.Marker.KEY_CANSETCAMERA);
                    }

                    if (AllowSize)
                    {
                        AllowSize = Mr.AllowByType(SaveLua.Marker.KEY_SIZE);
                    }

                    if (AllowAmount)
                    {
                        AllowAmount = Mr.AllowByType(SaveLua.Marker.KEY_AMOUNT);
                    }

                    if (!AllowConnect && !AllowCamera && !AllowSize && !AllowAmount)
                    {
                        break;
                    }
                }
            }

            Mr = null;

            NameInput.SetActive(AllowName);

            Connect.SetActive(AllowConnect);

            CameraZoom.SetActive(AllowCamera);
            SetCamera.SetActive(AllowCamera);
            SyncCamera.SetActive(AllowCamera);
            ViewCamera.SetActive(AllowCamera);

            Size.SetActive(AllowSize);

            Amount.SetActive(AllowAmount);

            ReadTypeMarker();

            if (AllowCamera)
            {
                ReadCameraMarker();
            }
            if (AllowSize)
            {
                ReadSizeMarker();
            }
            if (AllowAmount)
            {
                ReadAmountMarker();
            }

            if (AllowConnect)
            {
                ReadAdiacent();
            }
            else
            {
                Markers.MarkerConnected.Clear();
            }


            MarkerListControler.UpdateList();

            Loading = false;
        }