public CorotineManager()
 {
     SelfObject = new GameObject("CorotineManager");
     UnityEngine.Object.DontDestroyOnLoad(SelfObject);
     RootCorotineObject        = SelfObject.AddComponent <CorotineObject>();
     RootCorotineObject.Target = this;
 }
        static public void RemoveCorotineObjectByTarget(object target)
        {
            if (target == null || IsDispose)
            {
                return;
            }
            if (!Instance.CorotineDic.ContainsKey(target))
            {
                return;
            }

            CorotineObject tobj = Instance.CorotineDic[target];

            Instance.CorotineDic.Remove(target);
            UnityEngine.Object.DestroyImmediate(tobj.gameObject);
        }
        //获取的对象不会自动释放.必须手动调用Remove.
        static public CorotineObject GetCorotineObjectForTarget(object target)
        {
            if (target == null)
            {
                return(null);
            }
            if (Instance.CorotineDic.ContainsKey(target))
            {
                return(Instance.CorotineDic[target]);
            }
            GameObject tobj = new GameObject(target.ToString());

            tobj.transform.SetParent(Instance.SelfObject.transform, true);
            CorotineObject ret = tobj.AddComponent <CorotineObject>();

            ret.Target = target;
            Instance.CorotineDic.Add(target, ret);
            return(ret);
        }