コード例 #1
0
        public static void CreateReaction()
        {
            ReactionDef asset = ScriptableObject.CreateInstance <ReactionDef>();

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

            Selection.activeObject = asset;
            EditorUtility.FocusProjectWindow();
        }
コード例 #2
0
        public Reaction(ReactionDef _reactionDef, Reactor _reactor)
        {
            reactor         = _reactor;
            definition      = _reactionDef;
            theoreticalRate = definition.rate;

            foreach (ReactionCenter reactionCenter in definition.reactionCenters)
            {
                reactionCenter.reaction = this;
            }
        }
コード例 #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);
        }
コード例 #4
0
 public CollisionFreeReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }
コード例 #5
0
 public BindReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }
コード例 #6
0
 public ReleaseReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }
コード例 #7
0
 public CreateReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }
コード例 #8
0
 public StateChangeReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }
コード例 #9
0
 public DestroyReaction(ReactionDef _reactionDef, Reactor _reactor) : base(_reactionDef, _reactor)
 {
 }