Beispiel #1
0
 private void OnEnable()
 {
     if (UnityEngine.Object.op_Equality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
     {
         return;
     }
     TacticsSceneCamera.m_Instance = this;
     SceneBattle.Instance.SetNewCamera(TacticsSceneCamera.instance);
 }
Beispiel #2
0
 protected override void Awake()
 {
     base.Awake();
     TacticsSceneSettings.mScenes.Add(this);
     if (TacticsSceneSettings.AutoDeactivateScene)
     {
         ((Component)this).get_gameObject().SetActive(false);
         TacticsSceneSettings.AutoDeactivateScene = false;
     }
     TacticsSceneCamera.ClearInstance();
 }
Beispiel #3
0
        public static TacticsSceneCamera.RenderSet[] GetRenderSets(GameObject[] gobjs, string[] shaders)
        {
            List <TacticsSceneCamera.RenderSet> renderSetList = new List <TacticsSceneCamera.RenderSet>();

            for (int index = 0; index < gobjs.Length; ++index)
            {
                TacticsSceneCamera.RenderSet renderSet = TacticsSceneCamera.GetRenderSet(gobjs[index], shaders);
                if (renderSet != null)
                {
                    renderSetList.Add(renderSet);
                }
            }
            return(renderSetList.ToArray());
        }
Beispiel #4
0
 public static void Create(this TacticsSceneCamera.AllRangeObj self, TacticsSceneCamera.AllRange data)
 {
     if (data.groups == null)
     {
         return;
     }
     self.data   = data;
     self.groups = new TacticsSceneCamera.AllRangeObj.GroupObj[data.groups.Length];
     for (int index = 0; index < data.groups.Length; ++index)
     {
         TacticsSceneCamera.AllRangeObj.GroupObj groupObj = new TacticsSceneCamera.AllRangeObj.GroupObj();
         groupObj.data  = data.groups[index];
         groupObj.state = 0;
         groupObj.alpha = 1f;
         groupObj.renders.AddRange((IEnumerable <TacticsSceneCamera.RenderSet>)TacticsSceneCamera.GetRenderSets(groupObj.data.gobjs, (string[])null));
         self.groups[index] = groupObj;
     }
 }
Beispiel #5
0
 public static void ClearInstance()
 {
     TacticsSceneCamera.m_Instance = (TacticsSceneCamera)null;
 }
Beispiel #6
0
 public static TacticsSceneCamera.RenderSet GetRenderSet(GameObject gobj, string[] shaders)
 {
     TacticsSceneCamera.RenderSet renderSet = new TacticsSceneCamera.RenderSet();
     MeshRenderer[] componentsInChildren1   = (MeshRenderer[])gobj.GetComponentsInChildren <MeshRenderer>();
     for (int index1 = 0; index1 < componentsInChildren1.Length; ++index1)
     {
         if (!Application.get_isPlaying())
         {
             Material[] sharedMaterials = ((Renderer)componentsInChildren1[index1]).get_sharedMaterials();
             if (sharedMaterials != null && sharedMaterials.Length > 0)
             {
                 for (int index2 = 0; index2 < sharedMaterials.Length; ++index2)
                 {
                     if (TacticsSceneCamera.CheckMaterialShader(sharedMaterials[index2], shaders))
                     {
                         renderSet.meshRenderers.Add(componentsInChildren1[index1]);
                         renderSet.materials.Add(sharedMaterials[index2]);
                     }
                 }
             }
             else
             {
                 Material[] materials = ((Renderer)componentsInChildren1[index1]).get_materials();
                 for (int index2 = 0; index2 < materials.Length; ++index2)
                 {
                     if (TacticsSceneCamera.CheckMaterialShader(materials[index2], shaders))
                     {
                         renderSet.meshRenderers.Add(componentsInChildren1[index1]);
                         renderSet.materials.Add(materials[index2]);
                     }
                 }
             }
         }
         else
         {
             Material[] materials = ((Renderer)componentsInChildren1[index1]).get_materials();
             for (int index2 = 0; index2 < materials.Length; ++index2)
             {
                 if (TacticsSceneCamera.CheckMaterialShader(materials[index2], shaders))
                 {
                     renderSet.meshRenderers.Add(componentsInChildren1[index1]);
                     renderSet.materials.Add(materials[index2]);
                 }
             }
         }
     }
     SkinnedMeshRenderer[] componentsInChildren2 = (SkinnedMeshRenderer[])gobj.GetComponentsInChildren <SkinnedMeshRenderer>();
     for (int index1 = 0; index1 < componentsInChildren2.Length; ++index1)
     {
         Material[] materials = ((Renderer)componentsInChildren2[index1]).get_materials();
         for (int index2 = 0; index2 < materials.Length; ++index2)
         {
             if (TacticsSceneCamera.CheckMaterialShader(materials[index2], shaders))
             {
                 renderSet.skinRenderers.Add(componentsInChildren2[index1]);
                 renderSet.materials.Add(materials[index2]);
             }
         }
     }
     if (renderSet.materials.Count == 0)
     {
         return((TacticsSceneCamera.RenderSet)null);
     }
     return(renderSet);
 }
Beispiel #7
0
 private void OnDisable()
 {
     TacticsSceneCamera.m_Instance = (TacticsSceneCamera)null;
 }