Ejemplo n.º 1
0
        private void SelectPlatformCallback(object data)
        {
            if (this.trigger.igniters.ContainsKey((int)data))
            {
                return;
            }

            int index = this.spIgnitersKeys.arraySize;

            this.spIgnitersKeys.InsertArrayElementAtIndex(index);
            this.spIgnitersValues.InsertArrayElementAtIndex(index);

            this.spIgnitersKeys.GetArrayElementAtIndex(index).intValue = (int)data;

            Igniter igniter = this.trigger.gameObject.AddComponent <IgniterTriggerEnter>();

            igniter.Setup(this.trigger);
            igniter.enabled = false;

            this.spIgnitersValues.GetArrayElementAtIndex(index).objectReferenceValue = igniter;

            this.ignitersIndex = index;
            EditorPrefs.SetInt(KEY_IGNITER_INDEX_PREF, this.ignitersIndex);

            this.serializedObject.ApplyModifiedProperties();
            this.serializedObject.Update();

            this.updateIgnitersPlatforms = true;
        }
Ejemplo n.º 2
0
 private static void OnLoadCompleted(EventArgs args)
 {
     if (ObjectManager.Player.ChampionName == "Cassiopeia")
     {
         Notification.DrawNotification(new NotificationModel(Game.Time, 20f, 1f, ObjectManager.Player.ChampionName + " injected Ceviri TekinTR !", Color.DeepSkyBlue));
         Notification.DrawNotification(new NotificationModel(Game.Time, 20f, 1f, "Addon by: Mr Articuno", Color.Purple));
         new Cassiopeia().Init();
         Igniter.Init();
     }
     else
     {
         Notification.DrawNotification(new NotificationModel(Game.Time, 20f, 1f, ObjectManager.Player.ChampionName + " is Not Supported", Color.Red));
     }
 }
Ejemplo n.º 3
0
        private static void OnLoadCompleted(EventArgs args)
        {
            try
            {
                var handle = Activator.CreateInstance(null, "OneForWeek.Plugin.Hero." + ObjectManager.Player.ChampionName);
                Champion = (PluginModel)handle.Unwrap();
                Notification.DrawNotification(new NotificationModel(Game.Time, 20f, 1f, ObjectManager.Player.ChampionName + " injected !", Color.DeepSkyBlue));
                Notification.DrawNotification(new NotificationModel(Game.Time, 20f, 1f, "Addon by: MrArticuno", Color.Purple));
                Notification.DrawNotification(new NotificationModel(Game.Time, 20f, 1f, "Jinx is in BETA !", Color.Purple));

                Igniter.Init();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                Notification.DrawNotification(new NotificationModel(Game.Time, 20f, 1f, ObjectManager.Player.ChampionName + " is Not Supported", Color.Red));
            }
        }
Ejemplo n.º 4
0
        private void SelectNewIgniter(Type igniterType)
        {
            SerializedProperty property = this.spIgnitersValues.GetArrayElementAtIndex(this.ignitersIndex);

            if (property.objectReferenceValue != null)
            {
                DestroyImmediate(property.objectReferenceValue, true);
                property.objectReferenceValue = null;
            }

            Igniter igniter = (Igniter)this.trigger.gameObject.AddComponent(igniterType);

            igniter.Setup(this.trigger);
            igniter.enabled = false;

            property.objectReferenceValue          = igniter;
            this.ignitersCache[this.ignitersIndex] = new IgniterCache(igniter);

            serializedObject.ApplyModifiedProperties();
            serializedObject.Update();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// ギミック設置
        /// by柏 SE実装 2016.12.14
        /// </summary>
        /// <param name="mapdata">マップデータの二元配列</param>
        /// <param name="MapThings">マップ上の物のList</param>
        public static void CreateGimmicks(int[,] mapdata, List <GameObject> MapThings, Sound sound)
        {
            for (int i = 0; i < mapdata.GetLength(0); i++)
            {
                for (int j = 0; j < mapdata.GetLength(1); j++)
                {
                    switch (mapdata[i, j])
                    {
                    case (int)GimmickType.ICE:
                    {
                        Ice ice = new Ice(new Vector2(j * 64, i * 64), Vector2.Zero);
                        MapThings.Add(ice);
                        break;
                    }

                    case (int)GimmickType.IRON:
                    {
                        Iron iron = new Iron(new Vector2(j * 64, i * 64), Vector2.Zero);
                        MapThings.Add(iron);
                        break;
                    }

                    case (int)GimmickType.LIGHT:
                    {
                        Light light = new Light(new Vector2(j * 64, i * 64));
                        MapThings.Add(light);
                        break;
                    }

                    case (int)GimmickType.STRAW:
                    {
                        Straw straw = new Straw(new Vector2(j * 64, i * 64));
                        MapThings.Add(straw);
                        break;
                    }

                    case (int)GimmickType.COAL:
                    {
                        Coal coal = new Coal(new Vector2(j * 64, i * 64), Vector2.Zero);
                        MapThings.Add(coal);
                        break;
                    }

                    case (int)GimmickType.GOAL:
                    {
                        Goal goal = new Goal(new Vector2(j * 64, i * 64), sound);
                        MapThings.Add(goal);
                        break;
                    }

                    case (int)GimmickType.WATER:
                    {
                        Water water = new Water(new Vector2(j * 64, i * 64), Vector2.Zero);
                        MapThings.Add(water);
                        break;
                    }

                    case (int)GimmickType.WOOD:
                    {
                        Wood wood = new Wood(new Vector2(j * 64, i * 64));
                        MapThings.Add(wood);
                        break;
                    }

                    case (int)GimmickType.TREE:
                    {
                        Tree tree = new Tree(new Vector2(j * 64, i * 64));
                        MapThings.Add(tree);
                        break;
                    }

                    case (int)GimmickType.SAND:
                    {
                        Sand sand = new Sand(new Vector2(j * 64, i * 64), Vector2.Zero);
                        MapThings.Add(sand);
                        break;
                    }

                    case (int)GimmickType.BALLOON:
                    {
                        Balloon balloon = new Balloon(new Vector2(j * 64, i * 64), Vector2.Zero);
                        MapThings.Add(balloon);
                        break;
                    }

                    //葉梨竜太
                    case (int)GimmickType.HIGHLIGHT3:
                    {
                        MoveLight moveLight = new MoveLight(new Vector2(j * 64, i * 64), new Vector2(j * 64, (i + 3) * 64), Parameter.MoveLightSpeed);
                        MapThings.Add(moveLight);
                        break;
                    }

                    case (int)GimmickType.SIDELIGHT3:
                    {
                        MoveLight moveLight = new MoveLight(new Vector2(j * 64, i * 64), new Vector2((j + 3) * 64, i * 64), Parameter.MoveLightSpeed);
                        MapThings.Add(moveLight);
                        break;
                    }

                    case (int)GimmickType.HIGHLIGHT5:
                    {
                        MoveLight moveLight = new MoveLight(new Vector2(j * 64, i * 64), new Vector2(j * 64, (i + 5) * 64), Parameter.MoveLightSpeed);
                        MapThings.Add(moveLight);
                        break;
                    }

                    case (int)GimmickType.SIDELIGHT5:
                    {
                        MoveLight moveLight = new MoveLight(new Vector2(j * 64, i * 64), new Vector2((j + 5) * 64, i * 64), Parameter.MoveLightSpeed);
                        MapThings.Add(moveLight);
                        break;
                    }

                    case (int)GimmickType.JSIGN:
                    {
                        Sign sign = new Sign(new Vector2(j * 64, i * 64), (int)GimmickType.JSIGN);
                        MapThings.Add(sign);
                        break;
                    }

                    //葉梨竜太 11/30
                    case (int)GimmickType.BOMB:
                    {
                        Bomb bomb = new Bomb(new Vector2(j * 64, i * 64), sound, Vector2.Zero);
                        MapThings.Add(bomb);
                        break;
                    }

                    //葉梨竜太
                    case (int)GimmickType.IGNITER_UR:
                    {
                        Igniter igniter = new Igniter(new Vector2(j * 64, i * 64), (int)GimmickType.IGNITER_UR);
                        MapThings.Add(igniter);
                        break;
                    }

                    case (int)GimmickType.IGNITER_UL:
                    {
                        Igniter igniter = new Igniter(new Vector2(j * 64, i * 64), (int)GimmickType.IGNITER_UL);
                        MapThings.Add(igniter);
                        break;
                    }

                    case (int)GimmickType.IGNITER_DR:
                    {
                        Igniter igniter = new Igniter(new Vector2(j * 64, i * 64), (int)GimmickType.IGNITER_DR);
                        MapThings.Add(igniter);
                        break;
                    }

                    case (int)GimmickType.IGNITER_DL:
                    {
                        Igniter igniter = new Igniter(new Vector2(j * 64, i * 64), (int)GimmickType.IGNITER_DL);
                        MapThings.Add(igniter);
                        break;
                    }

                    case (int)GimmickType.IGNITER_HIGHT:
                    {
                        Igniter igniter = new Igniter(new Vector2(j * 64, i * 64), (int)GimmickType.IGNITER_HIGHT);
                        MapThings.Add(igniter);
                        break;
                    }

                    case (int)GimmickType.IGNITER_SIDE:
                    {
                        Igniter igniter = new Igniter(new Vector2(j * 64, i * 64), (int)GimmickType.IGNITER_SIDE);
                        MapThings.Add(igniter);
                        break;
                    }

                    //葉梨竜太
                    case (int)GimmickType.MSIGN:
                    {
                        Sign sign = new Sign(new Vector2(j * 64, i * 64), (int)GimmickType.MSIGN);
                        MapThings.Add(sign);
                        break;
                    }

                    case (int)GimmickType.RSIGN:
                    {
                        Sign sign = new Sign(new Vector2(j * 64, i * 64), (int)GimmickType.RSIGN);
                        MapThings.Add(sign);
                        break;
                    }

                    case (int)GimmickType.LSIGN:
                    {
                        Sign sign = new Sign(new Vector2(j * 64, i * 64), (int)GimmickType.LSIGN);
                        MapThings.Add(sign);
                        break;
                    }

                    case (int)GimmickType.CSIGN:
                    {
                        Sign sign = new Sign(new Vector2(j * 64, i * 64), (int)GimmickType.CSIGN);
                        MapThings.Add(sign);
                        break;
                    }

                    // 1/13 葉梨竜太
                    case (int)GimmickType.ROCK:
                    {
                        Stone stone = new Stone(new Vector2(j * 64, i * 64));
                        MapThings.Add(stone);
                        break;
                    }
                    }
                }
            }
        }
Ejemplo n.º 6
0
        private void DoLayoutConfigurationOptions()
        {
            this.sectionTrigger.PaintSection();
            using (var group = new EditorGUILayout.FadeGroupScope(this.sectionTrigger.state.faded))
            {
                if (group.visible)
                {
                    EditorGUILayout.BeginVertical(CoreGUIStyles.GetBoxExpanded());

                    int removeIndex = -1;

                    EditorGUILayout.BeginVertical(EditorStyles.helpBox);
                    EditorGUILayout.BeginHorizontal();

                    int ignitersIndex = GUILayout.Toolbar(this.ignitersIndex, IGNITERS_PLATFORM_NAMES);
                    if (ignitersIndex != this.ignitersIndex)
                    {
                        this.ignitersIndex = ignitersIndex;
                        EditorPrefs.SetInt(KEY_IGNITER_INDEX_PREF, this.ignitersIndex);
                    }

                    if (GUILayout.Button("+", CoreGUIStyles.GetButtonLeft(), GUILayout.Width(30f)))
                    {
                        this.SelectPlatformMenu();
                    }

                    EditorGUI.BeginDisabledGroup(this.ignitersIndex == 0);
                    if (GUILayout.Button("-", CoreGUIStyles.GetButtonRight(), GUILayout.Width(30f)))
                    {
                        removeIndex = this.ignitersIndex;
                    }

                    EditorGUI.EndDisabledGroup();
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();

                    EditorGUILayout.PrefixLabel(this.ignitersCache[this.ignitersIndex].name, EditorStyles.miniBoldLabel);
                    GUILayout.FlexibleSpace();

                    if (GUILayout.Button("Change Trigger", GUILayout.Width(SelectTypePanel.WINDOW_WIDTH)))
                    {
                        SelectTypePanel selectTypePanel = new SelectTypePanel(this.SelectNewIgniter, "Triggers", typeof(Igniter));
                        PopupWindow.Show(this.selectIgniterButtonRect, selectTypePanel);
                    }

                    if (UnityEngine.Event.current.type == EventType.Repaint)
                    {
                        this.selectIgniterButtonRect = GUILayoutUtility.GetLastRect();
                    }

                    EditorGUILayout.EndHorizontal();

                    if (this.ignitersCache[this.ignitersIndex].serializedObject != null)
                    {
                        string comment = this.ignitersCache[this.ignitersIndex].comment;
                        if (!string.IsNullOrEmpty(comment))
                        {
                            EditorGUILayout.HelpBox(comment, MessageType.Info);
                        }

                        Igniter.PaintEditor(this.ignitersCache[this.ignitersIndex].serializedObject);
                    }

                    if (this.ignitersCache[this.ignitersIndex].requiresCollider)
                    {
                        Collider collider = this.trigger.GetComponent <Collider>();
                        if (!collider)
                        {
                            this.PaintNoCollider();
                        }
                    }

                    EditorGUILayout.EndVertical();

                    if (removeIndex > 0)
                    {
                        UnityEngine.Object obj = this.spIgnitersValues.GetArrayElementAtIndex(removeIndex).objectReferenceValue;
                        this.spIgnitersValues.GetArrayElementAtIndex(removeIndex).objectReferenceValue = null;

                        this.spIgnitersKeys.DeleteArrayElementAtIndex(removeIndex);
                        this.spIgnitersValues.DeleteArrayElementAtIndex(removeIndex);

                        if (obj != null)
                        {
                            DestroyImmediate(obj, true);
                        }

                        this.serializedObject.ApplyModifiedProperties();
                        this.serializedObject.Update();

                        this.updateIgnitersPlatforms = true;
                        if (this.ignitersIndex >= this.spIgnitersKeys.arraySize)
                        {
                            this.ignitersIndex = this.spIgnitersKeys.arraySize - 1;
                        }
                    }

                    EditorGUILayout.Space();
                    this.PaintAdvancedSettings();
                    GUILayout.Space(2);

                    EditorGUILayout.EndVertical();
                }
            }
        }
Ejemplo n.º 7
0
        // INITIALIZERS: -----------------------------------------------------------------------------------------------

        private void OnEnable()
        {
            if (serializedObject == null)
            {
                return;
            }


            this.trigger = (NetworkItem)target;

            this.tabIndex = this.prevTabIndex = EditorPrefs.GetInt(string.Format(KEY_STATE, target.GetHashCode()));

            this.sectionTrigger = new Section(
                "Pickup Trigger", "Trigger icon.png", this.Repaint,
                "Assets/Gizmos/GameCreator/Core");

            //this.sectionParameters = new EditorGUIUtils.Section("Parameters", "List.png", this.Repaint);
            this.sectionStartActions = new Section(
                "On Start", "On Start.png", this.Repaint,
                "Assets/Plugins/GameCreator/Extra/Icons/Igniters");

            this.sectionEvent = new Section(
                "On Picked Up", "Pickup.png", this.Repaint);

            this.spRespawn = serializedObject.FindProperty("secondsBeforeRespawn");

            /*if(trigger.actions.Count == 0)
             * {
             *  trigger.actions.Add(new Actions() { actionsList = trigger.onPickUpActions });
             * }*/

            SerializedProperty spIgniters = serializedObject.FindProperty("igniters");

            this.spIgnitersKeys   = spIgniters.FindPropertyRelative("keys");
            this.spIgnitersValues = spIgniters.FindPropertyRelative("values");

            if (this.spIgnitersKeys.arraySize == 0)
            {
                Igniter igniter = this.trigger.gameObject.AddComponent <IgniterTriggerEnter>();
                igniter.Setup(this.trigger);
                igniter.enabled = false;

                this.spIgnitersKeys.InsertArrayElementAtIndex(0);
                this.spIgnitersValues.InsertArrayElementAtIndex(0);

                this.spIgnitersKeys.GetArrayElementAtIndex(0).intValue = Trigger.ALL_PLATFORMS_KEY;
                this.spIgnitersValues.GetArrayElementAtIndex(0).objectReferenceValue = igniter;

                this.serializedObject.ApplyModifiedProperties();
                this.serializedObject.Update();
            }

            this.UpdateIgnitersPlatforms();

            this.ignitersIndex = EditorPrefs.GetInt(KEY_IGNITER_INDEX_PREF, 0);
            if (this.ignitersIndex >= this.spIgnitersKeys.arraySize)
            {
                this.ignitersIndex = this.spIgnitersKeys.arraySize - 1;
                EditorPrefs.SetInt(KEY_IGNITER_INDEX_PREF, this.ignitersIndex);
            }

            this.spMinDistance         = serializedObject.FindProperty("minDistance");
            this.spMinDistanceToPlayer = serializedObject.FindProperty("minDistanceToPlayer");
        }