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);
    }
Пример #2
0
 public static void Print(this ShapeBehaviourType type)
 {
     Debug.Log("枚举扩展方法Print: " + type.ToString());
 }