C#高级 (设计模式实例)
设计模式
?简单工厂模式
using System.Collections;
using UnityEngine;
using System;
public class UnityAssetsFactory
{
public static UnityAsset CreateUnityAssets(string assetType)
{
switch (assetType)
{
case "GameObject":
return new PrefabAssets("");
case "Sprite":
return new SpriteAsset("");
default:
return null;
}
}
}
public abstract class UnityAsset
{
pub
C#高级 (设计模式实例)最先出现在Python成神之路。
共有 0 条评论