public static GOECameraCurve AddCameraCurve()
 {
     if ((GOERoot.GOECamera as GOECamera).GetComponent <GOECameraCurve>() == null)
     {
         return(ComponentObject.Add <GOECameraCurve>(GOERoot.GOECamera as GOECamera));
     }
     return(null);
 }
Example #2
0
        public static GOECameraShake AddCameraShake()
        {
            var shake = (GOERoot.GOECamera as GOECamera).GetComponent <GOECameraShake>();

            if (shake == null)
            {
                return(ComponentObject.Add <GOECameraShake>(GOERoot.GOECamera as GOECamera));
            }
            return(shake);
        }
        static internal T Add <T>(ComponentObject obj) where T : GOEBaseComponent, new()
        {
            T t = obj.GetComponent <T>();

            if (null == t)
            {
                t = obj.AddComponent <T>();
            }

            return(t);
        }
 static internal void EnableComponent <T>(ComponentObject obj, bool bEnable) where T : GOEBaseComponent, new()
 {
     if (bEnable)
     {
         T t = Add <T>(obj);
         t.Enable = bEnable;
     }
     else
     {
         T t = obj.GetComponent <T>();
         if (t != null)
         {
             t.Enable = bEnable;
         }
     }
 }