Ejemplo n.º 1
0
    public T AddBehaviour <T>() where T : ShapeBehaviour, new()
    {
        T behaviour = ShapeBehaviourPool <T> .Get();

        behaviourList.Add(behaviour);
        return(behaviour);
    }
Ejemplo n.º 2
0
    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);
 }
Ejemplo n.º 5
0
 public override void Recyle()
 {
     ShapeBehaviourPool <SatelliteShapeBehaviour> .Reclaim(this);
 }
Ejemplo n.º 6
0
 public override void Recyle()
 {
     ShapeBehaviourPool <RotationShapeBehaviour> .Reclaim(this);
 }
Ejemplo n.º 7
0
 public override void Recyle()
 {
     ShapeBehaviourPool <MovementShapeBehaviour> .Reclaim(this);
 }
Ejemplo n.º 8
0
 public override void Recycle()
 {
     ShapeBehaviourPool <GrowingShapeBehavior> .Reclaim(this);
 }
 public override void Recycle()
 {
     ShapeBehaviourPool <LifecycleShapeBehavior> .Reclaim(this);
 }