public static bool MatchName(CamModifier iter, string name) { if (iter == null) { return(false); } return(iter.name.ToLower() == name.ToLower()); }
// Create Modifier private CamModifier CreateModifier(string respath) { GameObject mod_res = Resources.Load(respath) as GameObject; if (mod_res == null) { return(null); } GameObject mod_go = GameObject.Instantiate(mod_res) as GameObject; if (mod_go == null) { return(null); } mod_go.name = mod_res.name; CamModifier cam_mod = mod_go.GetComponent <CamModifier>(); cam_mod.name = mod_res.name; if (cam_mod == null) { GameObject.Destroy(mod_go); return(null); } if (cam_mod is CamMode) { mod_go.transform.parent = m_ModeGroup; } else if (cam_mod is CamEffect) { mod_go.transform.parent = m_EffectGroup; } else if (cam_mod is CamConstraint) { mod_go.transform.parent = m_ConstraintGroup; } else { mod_go.transform.parent = transform; } return(cam_mod); }