Ejemplo n.º 1
0
 public void AddWorldProperty(WorldPropertyScriptable worldProperty)
 {
     if (!WorldProperties.Contains(worldProperty))
     {
         WorldProperties.Add(worldProperty);
         UnityEditor.EditorUtility.SetDirty(this);
     }
 }
Ejemplo n.º 2
0
        public WorldPropertyScriptable GetWorldProperty(string guid)
        {
            WorldPropertyScriptable foundProperty = WorldProperties.Find(property => property.guid == guid);

            UnityEngine.Debug.Assert(foundProperty != null, "Couldn't find property with guid " + guid);

            return(foundProperty);
        }
Ejemplo n.º 3
0
        public override void OnInspectorGUI()
        {
            WorldPropertyScriptable myTarget = (WorldPropertyScriptable)target;

            if (GUILayout.Button("Generate GUID"))
            {
                myTarget.guid = GUID.Generate().ToString();
            }

            DrawDefaultInspector();
        }
Ejemplo n.º 4
0
        public void Remove <T>(T asset) where T : ScriptableObject
        {
            WorldPropertyScriptable property = asset as WorldPropertyScriptable;

            if (property != null)
            {
                if (WorldProperties.Remove(property))
                {
                    UnityEditor.EditorUtility.SetDirty(this);
                }
            }
            else
            {
                Action action = asset as Action;
                if (Actions.Remove(action))
                {
                    UnityEditor.EditorUtility.SetDirty(this);
                }
            }
        }
Ejemplo n.º 5
0
Archivo: Beat.cs Proyecto: Yann4/Thesis
        private void DeserialiseVersion1(BinaryReader reader)
        {
            int preconditionCount = reader.ReadInt32();

            for (int idx = 0; idx < preconditionCount; idx++)
            {
                ScriptablePreconditions.Add(WorldPropertyScriptable.Deserialise(reader));
                if (ScriptablePreconditions[idx] != null)
                {
                    Preconditions.Add(ScriptablePreconditions[idx].GetRuntimeProperty());
                }
            }

            Archetype = new PlayerArchetype(reader);

            Importance = reader.ReadSingle();
            Order      = reader.ReadInt32();

            MaxRepetitions       = reader.ReadInt32();
            RepetitionsPerformed = reader.ReadInt32();

            int requiredActionCount = reader.ReadInt32();

            for (int idx = 0; idx < requiredActionCount; idx++)
            {
                RequiredActions.Add(Action.Deserialise(reader));
            }

            int optionalActionCount = reader.ReadInt32();

            for (int idx = 0; idx < optionalActionCount; idx++)
            {
                OptionalActions.Add(Action.Deserialise(reader));
            }

            Title = reader.ReadString();

            Generated = reader.ReadBoolean();
        }