public GameObject GetGameObjectVarValue(string name) { plyVar plyVar = this.variables.FindVariable(name); if (plyVar == null) { return(null); } plyVar_Component plyVar_Component = plyVar.ValueHandler as plyVar_Component; if (plyVar_Component != null) { return(plyVar_Component.GetGameObject()); } return((GameObject)plyVar.GetValue()); }
public T GetComponentVarValue <T>(string name) where T : Component { plyVar plyVar = this.variables.FindVariable(name); if (plyVar == null) { return(null); } plyVar_Component plyVar_Component = plyVar.ValueHandler as plyVar_Component; if (plyVar_Component != null) { return(plyVar_Component.GetComponent <T>()); } plyVar_GameObject plyVar_GameObject = plyVar.ValueHandler as plyVar_GameObject; if (plyVar_GameObject != null) { return(plyVar_GameObject.GetComponent <T>()); } return((T)plyVar.GetValue()); }