コード例 #1
0
        public override void DrawInspector()
        {
            GUILayout.BeginVertical("Box");
            EditorGUILayout.LabelField("XScale");
            XScale = EditorGUILayout.FloatField(XScale);
            GUILayout.EndVertical();

            GUILayout.BeginVertical("Box");
            EditorGUILayout.LabelField("YScale");
            YScale = EditorGUILayout.FloatField(YScale);
            GUILayout.EndVertical();

            GUILayout.BeginVertical("Box");
            EditorGUILayout.LabelField("Cellular Type");
            type = (CellularType)EditorGUILayout.EnumPopup(type);
            GUILayout.EndVertical();

            GUILayout.BeginVertical("Box");
            EditorGUILayout.LabelField("Jitter");
            jitter = EditorGUILayout.Slider(jitter, 0f, 1f);
            GUILayout.EndVertical();

            GUILayout.BeginHorizontal("Box");
            EditorGUILayout.LabelField("Seed");
            seed = EditorGUILayout.FloatField(seed);
            if (GUILayout.Button("Random"))
            {
                seed = UnityEngine.Random.Range(0f, 1000f);
            }
            GUILayout.EndHorizontal();

            base.DrawInspector();
        }
コード例 #2
0
        public override void Draw()
        {
            base.Draw();
            GUILayout.BeginArea(rect);
            //Texture
            if (texture != null)
            {
                GUI.DrawTexture(new Rect(0 + rect.width / 8, 0 + rect.height / 5, rect.width - rect.width / 4, rect.height - rect.height / 4), texture);
            }

            GUILayout.EndArea();

            if (lastYScale != YScale || lastXScale != XScale || lastJitter != jitter || lastSeed != seed)
            {
                lastYScale = YScale;
                lastXScale = XScale;
                lastJitter = jitter;
                lastSeed   = seed;
                Compute(true);
            }

            if (lastType != type)
            {
                lastType = type;

                switch (type)
                {
                case CellularType.F1:
                    kernel = shader.FindKernel("F1DistanceSeamlessVoronoi");
                    break;

                case CellularType.F2:
                    kernel = shader.FindKernel("F2DistanceSeamlessVoronoi");
                    break;

                case CellularType.DistanceSub:
                    kernel = shader.FindKernel("FMinusDistanceSeamlessVoronoi");
                    break;

                case CellularType.DistanceMul:
                    kernel = shader.FindKernel("FMultDistanceSeamlessVoronoi");
                    break;

                case CellularType.OneMinusF:
                    kernel = shader.FindKernel("OneMinusDistanceSeamlessVoronoi");
                    break;
                }

                Compute(true);
            }
        }
コード例 #3
0
 public CellularNode()
 {
     title      = "Cellular Node";
     type       = CellularType.F1;
     lastType   = type;
     XScale     = 10;
     YScale     = 10;
     lastXScale = XScale;
     lastYScale = YScale;
     jitter     = 1f;
     lastJitter = jitter;
     seed       = 1000;
     lastSeed   = seed;
 }
コード例 #4
0
        public SimCorpMobile(IUserInOut userInOut) : base(userInOut)
        {
            int    micSensitivityRate = 70;
            string micBandwidth       = "40 - 20k Hz";

            vMicrophone = new Microphone(micSensitivityRate, micBandwidth, userInOut);

            int    outputPower      = 50;
            string speakerBandwidth = "20 - 18k Hz";

            vSpeaker = new Speaker(outputPower, speakerBandwidth, userInOut);

            CellularType cellModuleType  = CellularType.Lte;
            int          workingDistance = 1000;

            vCellModule = new CellularModule(cellModuleType, workingDistance, userInOut);

            int            screenHeight  = 1920;
            int            screenWidth   = 1080;
            ScreenType     screenType    = ScreenType.Lcd;
            int            brightness    = 73;
            int            contrast      = 57;
            IScreenProfile screenProfile = new BasicScreenProfile(brightness, contrast);

            vScreen = new TuningScreen(screenHeight, screenWidth, screenType, screenProfile, userInOut);

            int controlHeght         = 140;
            int controlWidth         = 68;
            int touchSensitivityRate = 90;

            vMultiTouchPanel = new MultiTouchPanel(controlHeght, controlWidth, touchSensitivityRate, userInOut);

            vMessageStorage = new MessageStorage {
                Contacts = new List <Contact> {
                    new Contact("John", 380101),
                    new Contact("Nick", 380102),
                    new Contact("Emma", 380103)
                }
            };

            ParallelType type = ParallelType.Task;

            vSMSProvider = GetSMSProvider(type);
            vBattery     = GetBattery(type, userInOut);
        }
コード例 #5
0
 public CellularModule(CellularType moduleType, int workingDistance, IUserInOut userInOut)
 {
     ModuleType      = moduleType;
     WorkingDistance = workingDistance;
     this.userInOut  = userInOut;
 }