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; } }
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) { }
public BindReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor) { }
public ReleaseReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor) { }
public CreateReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor) { }
public StateChangeReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor) { }
public DestroyReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor) { }