using UnityEngine;
using System.Collections;
using System.Collections.Generic;
///
/// 更新和平台sdk需要用到的一些静态值(更新为主)
///
public static class UpdateAndSDK
{
///
/// 是否处于注销状态
///
/// 如果返回真,就是注销状态
public static bool IsReLog()
{
if (GameObject.Find("MonoSingleton/TopStructManager") != null)
{
return true;
}
else
{
return false;
}
}
///
/// 删除那些标记好的,又没有绑定脚本的物体----注销的时候返回登录场景会有两套重复的预制物体,删除没有绑定脚本的那一套.
///
public static void DeleteObjectByTag()
{
GameObject[] gameobj = GameObject.FindGameObjectsWithTag("DBBG");
for (int i = 0; i < gameobj.Length; i++)
{
if (null != gameobj[i].GetComponent())
{
Object.DestroyImmediate(gameobj[i]);
}
}
GameObject[] gameobjby = GameObject.FindGameObjectsWithTag("DyBackGround");
for (int i = 0; i < gameobjby.Length; i++)
{
if (null != gameobjby[i].GetComponent())
{
Object.DestroyImmediate(gameobjby[i]);
}
}
//GameObject[] gameforeverUI = GameObject.FindGameObjectsWithTag("ForeverUI");
//for (int i = 0; i < gameforeverUI.Length; i++)
//{
// if (null != gameforeverUI[i].GetComponent())
// {
// Object.DestroyImmediate(gameforeverUI[i]);
// }
//}
GameObject GuideObj = GameObject.Find("MonoSingleton/GuideDataManager");
if (GuideObj != null)
{
Object.Destroy(GuideObj);
}
GameObject GuideserverObj = GameObject.Find("MonoSingleton/PlayerGuideServer");
if (GuideserverObj != null)
{
Object.Destroy(GuideserverObj);
}
}
///
/// 给物体添加脚本
///
///
///
private static void BindScript(string strGameObject,string strScript)
{
GameObject go= GameObject.Find(strGameObject);
if (null == go)
{
return;
}
if (null == go.GetComponent(strScript))
{
AssemblyHelper.Instance.BindScript(strScript, go);
}
}
///
/// splash场景里,绑定脚本
///
public static void InitSplashBindScript()
{
LogHelper.Log("splash场景里,绑定脚本 已去除!");
//BindScript("ForeverUI", "FontManager");
//BindScript("ForeverUI", "LevelManager");
//BindScript("ForeverUI/UI_LoadingWindow", "UI_LoadingWindow");
//BindScript("ForeverUI/UI_CueDialog", "UI_CueDialog");
//BindScript("ForeverUI/UI_DBControlWindow", "UI_DBControlWindow");
}
///
/// splash场景里,绑定上需要的预制物体
///
public static void InitPrefab()
{
//ResourceHelper.Instance.LoadAssetBundle("DragonBonesBG", ab =>
// {
// if (ab != null)
// {
// GameObject model = (GameObject)Object.Instantiate(ab.LoadAsset("DragonBonesBG"));
// BindScript("DragonBonesBG(Clone)", "DragonBonesBGControler");
// }
// });
}
}