public static void CreateReaction()
        {
            ReactionDef asset = ScriptableObject.CreateInstance <ReactionDef>();

            AssetDatabase.CreateAsset(asset, "Assets/Data/Reactions/newReaction.asset");
            AssetDatabase.SaveAssets();

            Selection.activeObject = asset;
            EditorUtility.FocusProjectWindow();
        }
        public Reaction(ReactionDef _reactionDef, Reactor _reactor)
        {
            reactor         = _reactor;
            definition      = _reactionDef;
            theoreticalRate = definition.rate;

            foreach (ReactionCenter reactionCenter in definition.reactionCenters)
            {
                reactionCenter.reaction = this;
            }
        }
Esempio n. 3
0
        public Reaction GetReactionForDefinition(ReactionDef definition)
        {
            switch (definition.type)
            {
            case ReactionType.Bind:
                return(bindReactions.Find(r => r.definition == definition));

            case ReactionType.Release:
                return(releaseReactions.Find(r => r.definition == definition));

            case ReactionType.StateChange:
                return(stateChangeReactions.Find(r => r.definition == definition));

            case ReactionType.Create:
                return(createReactions.Find(r => r.definition == definition));

            case ReactionType.Destroy:
                return(destroyReactions.Find(r => r.definition == definition));
            }
            return(null);
        }
 public CollisionFreeReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }
Esempio n. 5
0
 public BindReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }
 public ReleaseReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }
Esempio n. 7
0
 public CreateReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }
Esempio n. 8
0
 public StateChangeReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }
Esempio n. 9
0
 public DestroyReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }