void createObject(Type typeOfObj, bool isInit, bool isUpdate, bool isFixUpdate = false, bool isLateUpdte = false) { if (gameSubSystemList_.ContainsKey(typeOfObj)) { TyLogger.LogError("already exist a Object " + typeOfObj.ToString()); } else { object t = Activator.CreateInstance(typeOfObj); gameSubSystemList_.Add(typeOfObj, t); if (isInit) { ((GameSubSystem)t).init(); } if (isUpdate) { gameSubSystemUpdateList_.Add(typeOfObj, (GameSubSystem)t); } if (isFixUpdate) { gameSubSystemFixUpdateList_.Add(typeOfObj, (GameSubSystem)t); } if (isLateUpdte) { gameSubSystemLateUpdateList_.Add(typeOfObj, (GameSubSystem)t); } } }
/// <summary> /// 得到窗体预制件上的Atlas /// </summary> /// <param name="index">atlas序号,从0开始</param> /// <returns>找不到返回NULL</returns> public UIAtlas getPrefabUIAtlas(int index) { if (atlas_ != null && index < atlas_.Length) { return(atlas_[index]); } TyLogger.LogError("can't find atlas " + index); return(null); }
/// <summary> /// 初始化Bugly平台 /// </summary> /// <param name="info">初始化信息</param> static void initBugly(initInfo info) { if (agent_ == null) { agent_ = new TyBuglyAgent(); agent_.init(info); } else { TyLogger.LogError("SmCrashReport have already init"); } }
/// <summary> /// 显示窗口结束的计时结算 /// </summary> public void showTimeEnd() { float showTimeDuring = Time.realtimeSinceStartup - _showBeginTime; if (showTimeDuring > 1.0f && showTimeDuring < 10) { string str = windowName + RG_Utils.getLanguageString("CodeItem140"); #if ShowTimeMsgBox MsgBox.getInstance().show(str); #endif TyLogger.LogError(str); } }
/// <summary> /// 设置红点记录的状态,true是记录,false是清除 /// </summary> /// <param name="key"></param> /// <param name="state"></param> /// <returns>false表示没有设置成功</returns> public static bool SetPointState(string key, bool state) { int time = state ? (int)getNowSecond() : 0; try { PlayerPrefs.SetInt(key, time); return(true); } catch (System.Exception e) { TyLogger.LogError(e); return(false); } }
/// <summary> /// 得到窗体预制件上的Atlas /// </summary> /// <param name="atlasName">atlas名称</param> /// <returns>找不到返回NULL</returns> public UIAtlas getPrefabUIAtlas(string atlasName) { if (atlas_ != null) { for (int i = 0; i < atlas_.Length; i++) { if (atlas_[i].name.Equals(atlasName)) { return(atlas_[i]); } } } TyLogger.LogError("can't find atlas " + atlasName); return(null); }
void Awake() { if (_uiPanel != null && _uiScrollView != null) { float panelSoftness = panelSoftness_; if (_uiScrollView.movement == UIScrollView.Movement.Horizontal) { _uiPanel.clipSoftness = new Vector2(panelSoftness, 0); } else if (_uiScrollView.movement == UIScrollView.Movement.Vertical) { _uiPanel.clipSoftness = new Vector2(0, panelSoftness); } } else { TyLogger.LogError("Can't fine UIPanel or UIScrollView"); } Destroy(this); }
/// <summary> /// 创建已经初始化好的游戏对象 /// </summary> /// <param name="t">游戏对象实例</param> /// <param name="typeOfObj">类型</param> /// <param name="isUpdate">是否需要更新</param> void createObject(object t, Type typeOfObj, bool isUpdate, bool isFixUpdate = false, bool isLateUpdte = false) { if (gameSubSystemList_.ContainsKey(typeOfObj)) { TyLogger.LogError("Already exist an Object " + typeOfObj.ToString()); } else { gameSubSystemList_.Add(typeOfObj, t); if (isUpdate) { gameSubSystemUpdateList_.Add(typeOfObj, (GameSubSystem)t); } if (isFixUpdate) { gameSubSystemFixUpdateList_.Add(typeOfObj, (GameSubSystem)t); } if (isLateUpdte) { gameSubSystemLateUpdateList_.Add(typeOfObj, (GameSubSystem)t); } } }