protected void OnSelfEnter() { this.currentState = FakeDrop.FakeDropState.None; if (EntityWorld.Instance.EntSelf != null) { EntityWorld.Instance.EntSelf.GetFakeDrop(); } FakeDrop.DeleteFakeDrop(this); }
public override void PlayEndingCG(int timeline, Action onPlayCGEnd) { if (InstanceManager.IsCurrentInstanceWithTask) { UIManagerControl.Instance.HideAll(); FakeDrop.DeleteAllFakeDrop(); TimelineGlobal.Init(timeline, 1, onPlayCGEnd); } else if (onPlayCGEnd != null) { onPlayCGEnd.Invoke(); } }
protected void Waiting() { this.waitTime += this.deltaTime; if (this.waitTime < this.WaitDefaultTime) { return; } this.currentState = FakeDrop.FakeDropState.FlyToEntity; if (EntityWorld.Instance.ActSelf) { this.flyToEntityFxID = FXManager.Instance.PlayFXOfFollow(this.flyToEntityFxModelID, base.get_transform().get_position(), EntityWorld.Instance.ActSelf.FixTransform, (float)FakeDrop.FlyToEntityDefaultSpeed, 0.2f, 0f, delegate { if (EntityWorld.Instance.EntSelf != null) { EntityWorld.Instance.EntSelf.GetFakeDrop(); } FakeDrop.DeleteFakeDrop(this); }, FXClassification.Normal); } this.Hide(); }
public static FakeDrop CreateFakeDrop(int modelID, Vector3 originPoint, Vector3 waitPoint, int waitFxID, int flyToEntityFxID) { DiaoLuoMoXingBiao diaoLuoMoXingBiao = DataReader <DiaoLuoMoXingBiao> .Get(modelID); if (diaoLuoMoXingBiao == null) { return(null); } GameObject gameObject = GameObjectLoader.Instance.Get(diaoLuoMoXingBiao.path); if (gameObject == null) { return(null); } FakeDrop fakeDrop = gameObject.AddUniqueComponent <FakeDrop>(); fakeDrop.animator = fakeDrop.GetComponentInChildren <Animator>(); fakeDrop.get_gameObject().set_layer(LayerSystem.NameToLayer("Gear")); fakeDrop.get_transform().set_parent(FakeDrop.DropPool.get_transform()); fakeDrop.get_transform().set_position(originPoint); if (originPoint.x == waitPoint.x && originPoint.z == waitPoint.z) { fakeDrop.currentState = FakeDrop.FakeDropState.Wait; fakeDrop.waitPosition = originPoint; fakeDrop.flyToWaitPositionSpeed = Vector3.get_zero(); } else { fakeDrop.currentState = FakeDrop.FakeDropState.FlyToWait; fakeDrop.waitPosition = MySceneManager.GetTerrainPoint(waitPoint.x, waitPoint.z, waitPoint.y); fakeDrop.flyToWaitPositionSpeed = (fakeDrop.waitPosition - originPoint) / FakeDrop.FlyToWaitPositionDefaultTime; } fakeDrop.waitFxModelID = waitFxID; fakeDrop.waitCollider = fakeDrop.GetComponent <BoxCollider>(); fakeDrop.waitCollider.set_enabled(false); fakeDrop.flyToEntityFxModelID = flyToEntityFxID; FakeDrop.allFakeDrop.Add(fakeDrop); return(fakeDrop); }
public static void DeleteFakeDrop(FakeDrop drop) { FakeDrop.allFakeDrop.Remove(drop); drop.Delete(); }