public T AddBehaviour <T>() where T : ShapeBehaviour, new() { T behaviour = ShapeBehaviourPool <T> .Get(); behaviourList.Add(behaviour); return(behaviour); }
public static ShapeBehaviour GetInstance(this ShapeBehaviourType type) { switch (type) { case ShapeBehaviourType.Movement: return(ShapeBehaviourPool <MovementShapeBehaviour> .Get()); case ShapeBehaviourType.Rotation: return(ShapeBehaviourPool <RotationShapeBehaviour> .Get()); case ShapeBehaviourType.Oscillation: return(ShapeBehaviourPool <OscillationShapeBehaviour> .Get()); case ShapeBehaviourType.Satellite: return(ShapeBehaviourPool <SatelliteShapeBehaviour> .Get()); case ShapeBehaviourType.Growing: return(ShapeBehaviourPool <GrowingShapeBehaviour> .Get()); case ShapeBehaviourType.Lifecycle: return(ShapeBehaviourPool <LifecycleShapeBehaviour> .Get()); } Debug.LogError("Forgot to support " + type); return(null); }
public override void Recyle() { previousOscillation = 0f; ShapeBehaviourPool <OscillationShapeBehaviour> .Reclaim(this); }
public override void Recyle() { ShapeBehaviourPool<DyingShapeBehaviour>.Reclaim(this); }
public override void Recyle() { ShapeBehaviourPool <SatelliteShapeBehaviour> .Reclaim(this); }
public override void Recyle() { ShapeBehaviourPool <RotationShapeBehaviour> .Reclaim(this); }
public override void Recyle() { ShapeBehaviourPool <MovementShapeBehaviour> .Reclaim(this); }
public override void Recycle() { ShapeBehaviourPool <GrowingShapeBehavior> .Reclaim(this); }
public override void Recycle() { ShapeBehaviourPool <LifecycleShapeBehavior> .Reclaim(this); }