public BattleCameras() { _camCutInCamera = GameObject.Find("UIRoot/CutInCamera").GetComponent <BattleCutInCamera>(); _camCutInCamera.cullingMask = (Generics.Layers.UI2D | Generics.Layers.CutIn); _camCutInCamera.depth = 6f; _camCutInCamera.clearFlags = CameraClearFlags.Depth; _camCutInEffectCamera = GameObject.Find("UIRoot/CutInEffectCamera").GetComponent <BattleCutInEffectCamera>(); _camCutInEffectCamera.cullingMask = Generics.Layers.CutIn; _camCutInEffectCamera.isCulling = false; _camCutInEffectCamera.depth = 5f; _camCutInEffectCamera.clearFlags = CameraClearFlags.Depth; _listCameras = new List <BattleFieldCamera>(); foreach (int value in Enum.GetValues(typeof(FleetType))) { if (value != 2) { BattleFieldCamera item = (!GameObject.Find($"Stage/{(FleetType)value}FieldCamera")) ? null : GameObject.Find($"Stage/{(FleetType)value}FieldCamera").GetComponent <BattleFieldCamera>(); _listCameras.Add(item); if (_listCameras[value] != null) { _listCameras[value].cullingMask = GetDefaultLayers(); _listCameras[value].ResetMotionBlur(); _listCameras[value].depth = 0f; } } } _camFieldDimCamera = BattleFieldDimCamera.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabFieldDimCamera).GetComponent <BattleFieldDimCamera>(), BattleTaskManager.GetStage()); _camFieldDimCamera.syncTarget = _listCameras[0].transform; _camFieldDimCamera.cullingMask = GetDefaultDimLayers(); _camFieldDimCamera.isCulling = false; _camFieldDimCamera.depth = -1f; }
public static BattleFieldDimCamera Instantiate(BattleFieldDimCamera prefab, Transform parent) { BattleFieldDimCamera battleFieldDimCamera = Object.Instantiate(prefab); battleFieldDimCamera.transform.parent = parent; battleFieldDimCamera.transform.position = Vector3.zero; battleFieldDimCamera.transform.localScale = Vector3.one; battleFieldDimCamera.name = "BattleFieldDimCamera"; return(battleFieldDimCamera); }
public static BattleFieldDimCamera Instantiate(BattleFieldDimCamera prefab, Transform parent) { BattleFieldDimCamera battleFieldDimCamera = Object.Instantiate <BattleFieldDimCamera>(prefab); battleFieldDimCamera.get_transform().set_parent(parent); battleFieldDimCamera.get_transform().set_position(Vector3.get_zero()); battleFieldDimCamera.get_transform().set_localScale(Vector3.get_one()); battleFieldDimCamera.set_name("BattleFieldDimCamera"); return(battleFieldDimCamera); }
protected virtual void GraAddDimCameraMaskAlpha(float time) { BattleFieldDimCamera fieldDimCamera = BattleTaskManager.GetBattleCameras().fieldDimCamera; if (time == 0f) { fieldDimCamera.maskAlpha = 0.75f; } else { fieldDimCamera.SetMaskPlaneAlpha(0f, 0.75f, time); } }
protected virtual void SetDimCamera(bool isAttacker, Transform syncTarget) { BattleCameras battleCameras = BattleTaskManager.GetBattleCameras(); BattleFieldDimCamera fieldDimCamera = battleCameras.fieldDimCamera; if (isAttacker) { fieldDimCamera.syncTarget = syncTarget; fieldDimCamera.SyncTransform(); fieldDimCamera.cullingMask = battleCameras.GetDefaultLayers(); fieldDimCamera.maskAlpha = 0f; fieldDimCamera.isCulling = true; fieldDimCamera.isSync = true; } }
public BattleCameras() { this._camCutInCamera = GameObject.Find("UIRoot/CutInCamera").GetComponent <BattleCutInCamera>(); this._camCutInCamera.cullingMask = (Generics.Layers.UI2D | Generics.Layers.CutIn); this._camCutInCamera.depth = 6f; this._camCutInCamera.clearFlags = 3; this._camCutInEffectCamera = GameObject.Find("UIRoot/CutInEffectCamera").GetComponent <BattleCutInEffectCamera>(); this._camCutInEffectCamera.cullingMask = Generics.Layers.CutIn; this._camCutInEffectCamera.isCulling = false; this._camCutInEffectCamera.depth = 5f; this._camCutInEffectCamera.clearFlags = 3; this._listCameras = new List <BattleFieldCamera>(); using (IEnumerator enumerator = Enum.GetValues(typeof(FleetType)).GetEnumerator()) { while (enumerator.MoveNext()) { FleetType fleetType = (FleetType)((int)enumerator.get_Current()); if (fleetType != FleetType.CombinedFleet) { BattleFieldCamera battleFieldCamera = (!GameObject.Find(string.Format("Stage/{0}FieldCamera", fleetType))) ? null : GameObject.Find(string.Format("Stage/{0}FieldCamera", fleetType)).GetComponent <BattleFieldCamera>(); this._listCameras.Add(battleFieldCamera); if (this._listCameras.get_Item((int)fleetType) != null) { this._listCameras.get_Item((int)fleetType).cullingMask = this.GetDefaultLayers(); this._listCameras.get_Item((int)fleetType).ResetMotionBlur(); this._listCameras.get_Item((int)fleetType).depth = 0f; } } } } this._camFieldDimCamera = BattleFieldDimCamera.Instantiate(BattleTaskManager.GetPrefabFile().prefabFieldDimCamera.GetComponent <BattleFieldDimCamera>(), BattleTaskManager.GetStage()); this._camFieldDimCamera.syncTarget = this._listCameras.get_Item(0).get_transform(); this._camFieldDimCamera.cullingMask = this.GetDefaultDimLayers(); this._camFieldDimCamera.isCulling = false; this._camFieldDimCamera.depth = -1f; }
protected virtual void GraSubDimCameraMaskAlpha(float time) { BattleFieldDimCamera fieldDimCamera = BattleTaskManager.GetBattleCameras().fieldDimCamera; fieldDimCamera.SetMaskPlaneAlpha(0.75f, 0f, time); }