private bool InitMoveCameraTo2D(object data) { BattleFieldCamera cam = BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(0); BattleShips battleShips = BattleTaskManager.GetBattleShips(); ProdDetectionStartCutIn pdsc = ProdDetectionStartCutIn.Instantiate(BattleTaskManager.GetPrefabFile().prefabProdDetectionStartCutIn.GetComponent <ProdDetectionStartCutIn>(), BattleTaskManager.GetBattleCameras().cutInCamera.get_transform()); ShipModel_Battle detectionPrimaryShip = ShipUtils.GetDetectionPrimaryShip(this._clsSakuteki.planes_f, true); UIBattleShip uIBattleShip = (detectionPrimaryShip == null) ? battleShips.flagShipFriend : battleShips.dicFriendBattleShips.get_Item(detectionPrimaryShip.Index); Vector3 vector = Mathe.NormalizeDirection(uIBattleShip.pointOfGaze, Vector3.get_zero()) * 30f; Vector3 fixChasingCamera = new Vector3(uIBattleShip.pointOfGaze.x, uIBattleShip.pointOfGaze.y, uIBattleShip.pointOfGaze.z + vector.z); cam.pointOfGaze = uIBattleShip.pointOfGaze; cam.ReqViewMode(CameraActor.ViewMode.FixChasing); cam.SetFixChasingCamera(fixChasingCamera); Vector3 endCamPos = new Vector3(uIBattleShip.pointOfGaze.x, 50f, uIBattleShip.pointOfGaze.z + vector.z * 6f); Transform transform = uIBattleShip.get_transform(); Vector3 position = BattleTaskManager.GetBattleShips().dicFriendBattleShips.get_Item(0).get_transform().get_position(); this._psDetectionRipple = Util.Instantiate(ParticleFile.Load(ParticleFileInfos.BattlePSDetectionRipple), null, false, false).GetComponent <ParticleSystem>(); this._psDetectionRipple.get_transform().set_parent(transform); this._psDetectionRipple.get_transform().set_position(new Vector3(position.x, position.y + 0.01f, position.z)); this._psDetectionRipple.Play(); pdsc.Play().Subscribe(delegate(bool _) { cam.get_transform().LTMove(endCamPos, 1.95f).setEase(LeanTweenType.easeInOutCubic); Mem.DelComponentSafe <ProdDetectionStartCutIn>(ref pdsc); }); return(false); }
public void Play(Action onFinished) { this._isPlaying = true; this._actOnFinished = onFinished; BattleTaskManager.GetBattleCameras().enemyFieldCamera.cullingMask = BattleTaskManager.GetBattleCameras().GetDefaultLayers(); this.TorpedoParticle = ParticleFile.Load <PSTorpedoWake>(ParticleFileInfos.PARTICLE_FILE_INFOS_ID_ST); this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this._initTorpedoCutInNInjection), new StatementMachine.StatementMachineUpdate(this._updateTorpedoCutInNInjection)); }
public void TestSaveMethod() { ParticleFile particleFile = new ParticleFile(); particleFile.Load(TEST_FILE); MemoryStream savedStream = new MemoryStream(); particleFile.Save(savedStream); savedStream.Seek(0, SeekOrigin.Begin); ParticleFile savedParticleFile = new ParticleFile(); savedParticleFile.Load(savedStream); savedStream.Close(); Assert.AreEqual(particleFile.Sequences.Count, savedParticleFile.Sequences.Count, "Sequence counts do not match"); for (int i = 0; i < particleFile.Sequences.Count; i++) { Assert.AreEqual(particleFile.Sequences[i].Name, savedParticleFile.Sequences[i].Name, "Sequence name values do not match"); Assert.AreEqual(particleFile.Sequences[i].Lifetime.Minimum, savedParticleFile.Sequences[i].Lifetime.Minimum, "Sequence minimum lifetime values do not match"); Assert.AreEqual(particleFile.Sequences[i].Lifetime.Maximum, savedParticleFile.Sequences[i].Lifetime.Maximum, "Sequence maximum lifetime values do not match"); Assert.AreEqual(particleFile.Sequences[i].EmitRate.Minimum, savedParticleFile.Sequences[i].EmitRate.Minimum, "Sequence minimum emit rate values do not match"); Assert.AreEqual(particleFile.Sequences[i].EmitRate.Maximum, savedParticleFile.Sequences[i].EmitRate.Maximum, "Sequence maximum emit rate values do not match"); Assert.AreEqual(particleFile.Sequences[i].LoopCount, savedParticleFile.Sequences[i].LoopCount, "Sequence loop count values do not match"); Assert.AreEqual(particleFile.Sequences[i].SpawnDirection.Minimum, savedParticleFile.Sequences[i].SpawnDirection.Minimum, "Sequence minimum spawn direction values do not match"); Assert.AreEqual(particleFile.Sequences[i].SpawnDirection.Maximum, savedParticleFile.Sequences[i].SpawnDirection.Maximum, "Sequence maximum spawn direction values do not match"); Assert.AreEqual(particleFile.Sequences[i].EmitRadius.Minimum, savedParticleFile.Sequences[i].EmitRadius.Minimum, "Sequence minimum emit radius values do not match"); Assert.AreEqual(particleFile.Sequences[i].EmitRadius.Maximum, savedParticleFile.Sequences[i].EmitRadius.Maximum, "Sequence maximum emit radius values do not match"); Assert.AreEqual(particleFile.Sequences[i].Gravity.Minimum, savedParticleFile.Sequences[i].Gravity.Minimum, "Sequence minimum gravity values do not match"); Assert.AreEqual(particleFile.Sequences[i].Gravity.Maximum, savedParticleFile.Sequences[i].Gravity.Maximum, "Sequence maximum gravity values do not match"); Assert.AreEqual(particleFile.Sequences[i].TextureFileName, savedParticleFile.Sequences[i].TextureFileName, "Sequence texture file names do not match"); Assert.AreEqual(particleFile.Sequences[i].ParticleCount, savedParticleFile.Sequences[i].ParticleCount, "Sequence particle counts do not match"); Assert.AreEqual(particleFile.Sequences[i].Alignment, savedParticleFile.Sequences[i].Alignment, "Sequence alignment values do not match"); Assert.AreEqual(particleFile.Sequences[i].UpdateCoordinate, savedParticleFile.Sequences[i].UpdateCoordinate, "Sequence update coordinate values do not match"); Assert.AreEqual(particleFile.Sequences[i].TextureWidth, savedParticleFile.Sequences[i].TextureWidth, "Sequence texture width values do not match"); Assert.AreEqual(particleFile.Sequences[i].TextureHeight, savedParticleFile.Sequences[i].TextureHeight, "Sequence texture height values do not match"); Assert.AreEqual(particleFile.Sequences[i].Implementation, savedParticleFile.Sequences[i].Implementation, "Sequence implementation values do not match"); Assert.AreEqual(particleFile.Sequences[i].DestinationBlendMode, savedParticleFile.Sequences[i].DestinationBlendMode, "Sequence destination blend mode values do not match"); Assert.AreEqual(particleFile.Sequences[i].SourceBlendMode, savedParticleFile.Sequences[i].SourceBlendMode, "Sequence source blend mode values do not match"); Assert.AreEqual(particleFile.Sequences[i].BlendOperation, savedParticleFile.Sequences[i].BlendOperation, "Sequence blend operation values do not match"); Assert.AreEqual(particleFile.Sequences[i].Events.Count, savedParticleFile.Sequences[i].Events.Count, "Event counts do not match"); for (int j = 0; j < particleFile.Sequences[i].Events.Count; j++) { Assert.AreEqual(particleFile.Sequences[i].Events[j].Type, savedParticleFile.Sequences[i].Events[j].Type, "Event type values do not match"); Assert.AreEqual(particleFile.Sequences[i].Events[j].Fade, savedParticleFile.Sequences[i].Events[j].Fade, "Event fade values do not match"); Assert.AreEqual(particleFile.Sequences[i].Events[j].TimeRange.Minimum, savedParticleFile.Sequences[i].Events[j].TimeRange.Minimum, "Event minimum time range values do not match"); Assert.AreEqual(particleFile.Sequences[i].Events[j].TimeRange.Maximum, savedParticleFile.Sequences[i].Events[j].TimeRange.Maximum, "Event maximum time range values do not match"); } } }
public void AddInstantiates(Transform parent, Vector3 injectionVec, Vector3 targetVec, bool isFull, int attackerIndex, float time, bool isDet, bool isMiss) { if (_torpedoWake == null) { _torpedoWake = ParticleFile.Load <PSTorpedoWake>(ParticleFileInfos.PARTICLE_FILE_INFOS_ID_ST); } if (_torpedoWakeD == null) { _torpedoWakeD = ParticleFile.Load <PSTorpedoWake>(ParticleFileInfos.BattlePSTorpedowakeD); } _listTorpedoWake.Add(PSTorpedoWake.Instantiate((!isFull) ? _torpedoWake : _torpedoWakeD, parent, injectionVec, targetVec, attackerIndex, time, isDet, isMiss)); }
private bool _initSupportTorpedoPhase1(object data) { SplashPar = ParticleFile.Load <ParticleSystem>(ParticleFileInfos.BattlePSSplashTorpedo); BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera; cutInEffectCamera.isCulling = true; Observable.FromCoroutine((IObserver <bool> observer) => CreateTorpedo1(observer)).Subscribe(delegate { _prodSupportTorpedoP1.Play(_onSupportTorpedoPhase1Finished); }); return(false); }
private ParticleSystem Instantiate() { if ((UnityEngine.Object)_par == null) { _par = ParticleFile.Load <ParticleSystem>(ParticleFileInfos.BattlePSSplashSmoke); } ParticleSystem val = UnityEngine.Object.Instantiate <ParticleSystem>(_par); ((Component)val).transform.parent = base.transform; ((Component)val).transform.position = base.transform.position; return(val); }
protected override bool Init() { _clsRaigeki = BattleTaskManager.GetBattleManager().GetKaimakuData(); if (_clsRaigeki == null) { EndPhase(BattleUtils.NextPhase(BattlePhase.OpeningTorpedoSalvo)); } else { _clsState = new StatementMachine(); _clsState.AddState(_initTorpedoCutInInjection, _updateTorpedoCutInInjection); TorpedoParticle = ParticleFile.Load <PSTorpedoWake>(ParticleFileInfos.PARTICLE_FILE_INFOS_ID_ST); } return(true); }
protected override bool Init() { base.Init(); this._clsRaigeki = BattleTaskManager.GetBattleManager().GetRaigekiData(); if (this._clsRaigeki == null) { this.EndPhase(BattleUtils.NextPhase(BattlePhase.TorpedoSalvo)); } else { this._clsState = new StatementMachine(); BattleTaskManager.GetBattleCameras().enemyFieldCamera.cullingMask = BattleTaskManager.GetBattleCameras().GetDefaultLayers(); this.TorpedoParticle = ParticleFile.Load <PSTorpedoWake>(ParticleFileInfos.PARTICLE_FILE_INFOS_ID_ST); this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this._initTorpedoCutInNInjection), new StatementMachine.StatementMachineUpdate(this._updateTorpedoCutInNInjection)); } return(true); }
public void TestLoadMethod() { Stream stream = File.OpenRead(TEST_FILE); stream.Seek(0, SeekOrigin.End); long fileSize = stream.Position; stream.Seek(0, SeekOrigin.Begin); ParticleFile particleFile = new ParticleFile(); particleFile.Load(stream); long streamPosition = stream.Position; stream.Close(); Assert.AreEqual(fileSize, streamPosition, "Not all of the file was read"); }
private void _onSupportFleetAdmissionFinished() { if (_clsShien is ShienModel_Rai) { _clsTorpedo = (ShienModel_Rai)_clsShien; TorpedoParticle = ParticleFile.Load <PSTorpedoWake>(ParticleFileInfos.BattlePSTorpedowakeD); _clsState.AddState(_initSupportTorpedoPhase1, _updateSupportTorpedoPhase1); } else if (_clsShien is ShienModel_Hou) { _clsShelling = (ShienModel_Hou)_clsShien; _clsState.AddState(_initSupportShelling, _updateSupportShelling); } else if (_clsShien is ShienModel_Air) { _clsAerial = (ShienModel_Air)_clsShien; _clsState.AddState(_initSupportAerialPhase1, _updateSupportAerialPhase1); } }
private bool InitMoveCameraTo2D(object data) { BattleFieldCamera cam = BattleTaskManager.GetBattleCameras().fieldCameras[0]; BattleShips battleShips = BattleTaskManager.GetBattleShips(); ProdDetectionStartCutIn pdsc = ProdDetectionStartCutIn.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdDetectionStartCutIn).GetComponent <ProdDetectionStartCutIn>(), BattleTaskManager.GetBattleCameras().cutInCamera.transform); ShipModel_Battle detectionPrimaryShip = ShipUtils.GetDetectionPrimaryShip(_clsSakuteki.planes_f, isFriend: true); UIBattleShip uIBattleShip = (detectionPrimaryShip == null) ? battleShips.flagShipFriend : battleShips.dicFriendBattleShips[detectionPrimaryShip.Index]; Vector3 vector = Mathe.NormalizeDirection(uIBattleShip.pointOfGaze, Vector3.zero) * 30f; Vector3 pointOfGaze = uIBattleShip.pointOfGaze; float x = pointOfGaze.x; Vector3 pointOfGaze2 = uIBattleShip.pointOfGaze; float y = pointOfGaze2.y; Vector3 pointOfGaze3 = uIBattleShip.pointOfGaze; Vector3 fixChasingCamera = new Vector3(x, y, pointOfGaze3.z + vector.z); cam.pointOfGaze = uIBattleShip.pointOfGaze; cam.ReqViewMode(CameraActor.ViewMode.FixChasing); cam.SetFixChasingCamera(fixChasingCamera); Vector3 pointOfGaze4 = uIBattleShip.pointOfGaze; float x2 = pointOfGaze4.x; Vector3 pointOfGaze5 = uIBattleShip.pointOfGaze; Vector3 endCamPos = new Vector3(x2, 50f, pointOfGaze5.z + vector.z * 6f); Transform transform = uIBattleShip.transform; Vector3 position = BattleTaskManager.GetBattleShips().dicFriendBattleShips[0].transform.position; _psDetectionRipple = Util.Instantiate(ParticleFile.Load(ParticleFileInfos.BattlePSDetectionRipple)).GetComponent <ParticleSystem>(); ((Component)_psDetectionRipple).transform.parent = transform; ((Component)_psDetectionRipple).transform.position = new Vector3(position.x, position.y + 0.01f, position.z); _psDetectionRipple.Play(); pdsc.Play().Subscribe(delegate { cam.transform.LTMove(endCamPos, 1.95f).setEase(LeanTweenType.easeInOutCubic); Mem.DelComponentSafe(ref pdsc); }); return(false); }
private PSTorpedoWake _createTorpedo(bool isOnes, Vector3 injection, Vector3 target, float _time, bool isDet, bool isMiss) { return(PSTorpedoWake.Instantiate((!isOnes) ? this._torpedoWake : ParticleFile.Load <PSTorpedoWake>(ParticleFileInfos.BattlePSTorpedowakeD), BattleTaskManager.GetBattleField().get_transform(), new Vector3(injection.x, injection.y + 1f, injection.z), new Vector3(target.x, target.y + 1f, target.z), 0, _time, isDet, isMiss)); }
private PSTorpedoWake _instantiateTorpedo(Vector3 injection, Vector3 target, int index, float _time, bool isDet, bool isMiss, bool isD) { return(PSTorpedoWake.Instantiate(injectionVec: new Vector3(injection.x, injection.y + 1f, injection.z), target: new Vector3(target.x, target.y + 1f, target.z), prefab: (!isD) ? _torpedoWake : ParticleFile.Load <PSTorpedoWake>(ParticleFileInfos.BattlePSTorpedowakeD), parent: BattleTaskManager.GetBattleField().transform, attacker: index, _time: _time, isDet: isDet, isMiss: isMiss)); }