static public void ForwardCollisionToCurrentState(GameObject target, Collision2DType type, Collision2D CollisionInfo) { PlayMakerFSM[] _fsms = target.GetComponents <PlayMakerFSM>(); foreach (PlayMakerFSM _fsm in _fsms) { FsmState _currentState = null; foreach (FsmState _state in _fsm.FsmStates) { if (_state.Name.Equals(_fsm.ActiveStateName)) { _currentState = _state; break; } } if (_currentState != null) { foreach (IFsmCollider2DStateAction _Action in _currentState.Actions) { if (type == Collision2DType.OnCollisionEnter2D) { _Action.DoCollisionEnter2D(CollisionInfo); } } } } }
public override void Reset() { collision = Collision2DType.OnCollisionEnter2D; collideTag = ""; sendEvent = null; storeCollider = null; storeForce = null; }
public override void Reset() { collision = Collision2DType.OnCollisionEnter2D; collideTag = new FsmString() { UseVariable = true }; options = Options.ColliderOnly; sendEvent = null; eventTarget = null; collideLayer = new FsmInt() { UseVariable = true }; storeCollideObject = null; storeForce = null; }
public static bool Check(Vertex Position, Vertex Scale, Vertex ColliderPosition, Vertex ColliderScale, Collision2DType Type) { if (Type == Collision2DType.Radius) { return(Collision2D.CheckRadiusCollision(Position, Scale, ColliderPosition, ColliderScale)); } else if (Type == Collision2DType.Rectangular) { return(Collision2D.CheckRectangularCollision(Position, Scale, ColliderPosition, ColliderScale)); } else if (Type == Collision2DType.Focus) { return(Collision2D.CheckFocusCollision(Position, Scale, ColliderPosition, ColliderScale)); } else if (Type == Collision2DType.Vertical) { return(Collision2D.CheckVerticalCollision(Position, Scale, ColliderPosition, ColliderScale)); } return(false); }
static public void ForwardCollisionToCurrentState(GameObject target,Collision2DType type, Collision2D CollisionInfo) { PlayMakerFSM[] _fsms = target.GetComponents<PlayMakerFSM>(); foreach(PlayMakerFSM _fsm in _fsms) { FsmState _currentState = null; foreach(FsmState _state in _fsm.FsmStates) { if (_state.Name.Equals(_fsm.ActiveStateName)) { _currentState = _state; break; } } if (_currentState!=null) { foreach(IFsmCollider2DStateAction _Action in _currentState.Actions ) { if (type == Collision2DType.OnCollisionEnter2D) { _Action.DoCollisionEnter2D(CollisionInfo); } } } } }
public override void Reset() { collision = Collision2DType.OnCollisionEnter2D; collideTag = "Untagged"; sendEvent = null; storeCollider = null; storeForce = null; }
public bool InCollision(DrawObject Collider, Collision2DType Type) { return(Collision2D.Check(this.Translation, this.Scale, Collider.Translation, Collider.Scale, Type)); }