void CreateInstance() { if (instance == null) { instance = this; } }
/// <summary> /// 改变窗帘对象 /// </summary> /// <param name="target"></param> public void ChangeTarget(ProdKind target) { if (target == Target) { //return; } Target = target; if (target == ProdKind.ChuangLian) { if (!isActiv) { } } else { #region switch Debug.Log(target.ToString()); switch (target) { case ProdKind.ChuangMan: FindName = "1"; break; case ProdKind.ChuangShen: FindName = "2"; break; case ProdKind.ChuangSha: FindName = "3"; break; case ProdKind.GuiDao: FindName = "4"; break; case ProdKind.ChuangYing: FindName = "5"; break; case ProdKind.ZhangTu: FindName = "6"; break; case ProdKind.DaiShi: FindName = "7"; break; case ProdKind.HuaBian: FindName = "8"; break; case ProdKind.ChuangJin: FindName = "9"; break; case ProdKind.CeGou: FindName = "10"; break; case ProdKind.BengDai: FindName = "11"; break; case ProdKind.ChuangGou: FindName = "12"; break; case ProdKind.ChuangDai: FindName = "13"; break; case ProdKind.PeiZhong: FindName = "14"; break; default: FindName = null; break; } #endregion GameObject Go = null; GameManageList.TryGetValue(FindName, out Go); //Debug.Log("Go3"); this.Go = Go; //Debug.Log("Go == null ? " + (Go == null) + "; FindName: " + FindName); //Debug.Log("ddddddddddddd" + Go.name); if (Go != null) { _changeTexture = Go.GetComponent <ChangeTexture>(); } else { _changeTexture = null; } } }
// Use this for initialization void Start() { instance = this; //Texture tex = Resources.Load("cu_cat_b_col_low",Texture); //renderer.material.mainTexture = Resources.Load("cu_cat_b_col_low",typeof(Texture))as Texture; }