private string GetSourceModelPathByType(SourceInfo.SourceType type) { string modelPath = string.Empty; if (GlobalConfig.ModelToSourceType.ContainsKey(type.ToString())) { modelPath = GlobalConfig.ModelToSourceType[type.ToString()]; //Debug.Log( "GetSourceModelPathByType(), " + modelPath ); } else { Debug.LogError("not have the config of source model: " + type.ToString()); } return(modelPath); }
private BaseSource AddScriptBySourceType(SourceInfo.SourceType type, GameObject target) { switch (type) { case SourceInfo.SourceType.Oxygen: return(target.AddComponent <OxygenPoint>()); case SourceInfo.SourceType.Fuel: return(target.AddComponent <FuelPoint>()); case SourceInfo.SourceType.ChestA: return(target.AddComponent <ChestAPoint>()); case SourceInfo.SourceType.ChestB: return(target.AddComponent <ChestBPoint>()); case SourceInfo.SourceType.ChestC: return(target.AddComponent <ChestCPoint>()); default: return(null); } }