protected virtual void Cast() { isFishIdentified = false; checkRelease = true; FishingManager.Cast(); ResetMooch(); }
private void OnLateUpdate() { FishingManager fishingSystem = Singleton <Manager.Map> .Instance.FishingSystem; switch (fishingSystem.scene) { case FishingManager.FishingScene.Fishing: float num = this.fishingGroup.heartPointImageWidth * fishingSystem.HeartPointScale; foreach (RectTransform heartPointRect in this.fishingGroup.heartPointRects) { Vector2 sizeDelta = heartPointRect.get_sizeDelta(); sizeDelta.x = (__Null)(double)num; heartPointRect.set_sizeDelta(sizeDelta); } float timeScale = fishingSystem.TimeScale; Color timeColor = this.GetTimeColor(fishingSystem.TimeScale); foreach (Image imageOutline in this.fishingGroup.imageOutlines) { float a = (float)((Graphic)imageOutline).get_color().a; timeColor.a = (__Null)(double)a; ((Graphic)imageOutline).set_color(timeColor); } foreach (CircleOutline circleOutline in this.fishingGroup.circleOutlines) { float a = (float)circleOutline.get_effectColor().a; timeColor.a = (__Null)(double)a; circleOutline.set_effectColor(timeColor); } float a1 = (float)((Graphic)this.fishingGroup.timerImage).get_color().a; timeColor.a = (__Null)(double)a1; ((Graphic)this.fishingGroup.timerImage).set_color(timeColor); this.fishingGroup.timerCircleImage.set_fillAmount(timeScale); break; } }
public void Initialize(FishingManager _fishingManager, Transform _rootPos, LineRenderer _line) { ActionItemInfo actionItemInfo; GameObject gameObject; if (Object.op_Equality((Object)this.bodyObject, (Object)null) && Singleton <Resources> .Instance.Map.EventItemList.TryGetValue(Singleton <Resources> .Instance.FishingDefinePack.IDInfo.LureEventItemID, out actionItemInfo) && Object.op_Inequality((Object)(gameObject = CommonLib.LoadAsset <GameObject>((string)actionItemInfo.assetbundleInfo.assetbundle, (string)actionItemInfo.assetbundleInfo.asset, false, (string)actionItemInfo.assetbundleInfo.manifest)), (Object)null)) { MapScene.AddAssetBundlePath((string)actionItemInfo.assetbundleInfo.assetbundle, (string)actionItemInfo.assetbundleInfo.manifest); this.bodyObject = (GameObject)Object.Instantiate <GameObject>((M0)gameObject, Vector3.get_zero(), Quaternion.get_identity()); this.bodyObject.get_transform().SetParent(((Component)this).get_transform(), false); this.floatingObject = this.bodyObject.GetOrAddComponent <FloatingObject>(); this.floatingObject.fishingSystem = _fishingManager; this.floatingObject.WaterEnterChecker = new Func <Collider, bool>(this.WaterInOutCheck); this.floatingObject.WaterStayChecker = new Func <Collider, bool>(this.WaterInOutCheck); this.floatingObject.WaterExitChecker = new Func <Collider, bool>(this.WaterInOutCheck); } this.fishingSystem = _fishingManager; this.RootPos = _rootPos; ((Component)this).get_transform().set_parent(this.RootPos); Transform transform = ((Component)this).get_transform(); Vector3 zero = Vector3.get_zero(); ((Component)this).get_transform().set_localEulerAngles(zero); Vector3 vector3 = zero; transform.set_localPosition(vector3); this.fishingLine = _line; this.state = Lure.State.Have; if (!Object.op_Implicit((Object)this.floatingObject)) { return; } this.floatingObject.UseWaterBuoyancy = false; }
// Start is called before the first frame update void Start() { timer = -Random.Range(0, 3f); moveDirection = new Vector2(Random.Range(0, 1f), Random.Range(0, 1f)); idleDuration = 3 + Random.Range(0, 3f); movingDuration = 1 + Random.Range(0, 1f); fishingManager = GameObject.Find("Game").GetComponent <FishingManager>(); }
private void Awake() { _rb2d = GetComponent <Rigidbody2D>(); _fishingManager = GameObject.FindWithTag("Fish").GetComponent <FishingManager>(); _limitPos = GameObject.FindWithTag("Background").GetComponent <SpriteRenderer>().bounds.size.y / 2; _startPos = transform.position; }
private void FitMoveAreaOnWater() { Vector3 _hitPosition; FishingManager.GetWaterPosition(this.fishingSystem.MoveArea.get_transform().get_position(), out _hitPosition); this.fishingSystem.MoveArea.get_transform().set_position(_hitPosition); this.fishingSystem.MoveArea.get_transform().set_localEulerAngles(Vector3.get_zero()); Vector3 originLocalPosition = this.fishingSystem.moveAreaOriginLocalPosition; originLocalPosition.y = this.fishingSystem.MoveArea.get_transform().get_localPosition().y; this.fishingSystem.moveAreaOriginLocalPosition = originLocalPosition; }
public void Initialize(FishingManager _fishingSystem, FishInfo _fishInfo) { this.state = Fish.State.None; this.fishInfo = _fishInfo; this.fishingSystem = _fishingSystem; this.activeNextPosition = false; if (Object.op_Inequality((Object)this.bodyObj, (Object)null)) { Object.Destroy((Object)this.bodyObj); } ((Component)this).get_transform().set_localScale(this.originScale); Tuple <AssetBundleInfo, RuntimeAnimatorController, string> tuple; if (Singleton <Resources> .Instance.Fishing.FishBodyTable.TryGetValue(this.fishInfo.SizeID, out tuple)) { // ISSUE: variable of the null type __Null assetbundle = tuple.Item1.assetbundle; // ISSUE: variable of the null type __Null asset = tuple.Item1.asset; // ISSUE: variable of the null type __Null manifest = tuple.Item1.manifest; GameObject gameObject; if (Object.op_Inequality((Object)(gameObject = CommonLib.LoadAsset <GameObject>((string)assetbundle, (string)asset, false, (string)manifest)), (Object)null)) { AssetBundleInfo assetBundleInfo = tuple.Item1; MapScene.AddAssetBundlePath((string)assetBundleInfo.assetbundle, (string)assetBundleInfo.manifest); this.bodyObj = (GameObject)Object.Instantiate <GameObject>((M0)gameObject, Vector3.get_zero(), Quaternion.get_identity()); this.fishAnim = (Animator)this.bodyObj.GetComponent <Animator>(); if (Object.op_Inequality((Object)this.fishAnim, (Object)null)) { this.fishAnim.set_runtimeAnimatorController(tuple.Item2); } this.eyeT = this.bodyObj.get_transform().FindLoop(tuple.Item3)?.get_transform() ?? ((Component)this).get_transform(); Renderer componentInChildren = (Renderer)this.bodyObj.GetComponentInChildren <Renderer>(true); float createOffsetHeight = Singleton <Resources> .Instance.FishingDefinePack.FishParam.CreateOffsetHeight; if (Object.op_Inequality((Object)componentInChildren, (Object)null)) { Bounds bounds1 = componentInChildren.get_bounds(); Vector3 center = ((Bounds) ref bounds1).get_center(); Bounds bounds2 = componentInChildren.get_bounds(); Vector3 extents = ((Bounds) ref bounds2).get_extents(); Vector3 position = this.bodyObj.get_transform().get_position(); ref Vector3 local1 = ref position; local1.z = local1.z - (extents.z + center.z); ref Vector3 local2 = ref position; local2.y = (__Null)(local2.y - (extents.y + center.y + 0.25)); ref Vector3 local3 = ref position; local3.y = (__Null)(local3.y + ((double)createOffsetHeight - extents.y)); this.bodyObj.get_transform().set_position(position); }
private void OnUpdate() { if (!Singleton <Manager.Map> .IsInstance()) { return; } FishingManager fishingSystem = Singleton <Manager.Map> .Instance.FishingSystem; if (fishingSystem.scene != FishingManager.FishingScene.SelectFood) { return; } float axis = fishingSystem.GetAxis(ActionID.MouseWheel); if (2 <= this.FoodInfoList.Count && this.foodChangeSubscriber == null) { if ((double)axis != 0.0) { IEnumerator _coroutine = this.ChangeFood((int)Mathf.Sign(axis)); this.foodChangeSubscriber = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => _coroutine), false)); } else if (fishingSystem.IsPressedVertical) { if (fishingSystem.IsPressedAxis(ActionID.SelectVertical)) { IEnumerator _coroutine = this.ChangeFood((int)Mathf.Sign(fishingSystem.GetAxis(ActionID.SelectVertical))); this.foodChangeSubscriber = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => _coroutine), false)); } else if (fishingSystem.IsPressedAxis(ActionID.MoveVertical)) { IEnumerator _coroutine = this.ChangeFood((int)Mathf.Sign(fishingSystem.GetAxis(ActionID.MoveVertical))); this.foodChangeSubscriber = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => _coroutine), false)); } } } if (0 < this.SelectedFishFood.Count && fishingSystem.NextButtonDown) { this.selectFoodGroup.Hide(); fishingSystem.ChangeFishScene(FishingManager.FishingScene.StartMotion); } else { if (!fishingSystem.BackButtonDown) { return; } fishingSystem.EndFishing(); } }
private void InitializeFirst() { this.fishingSystem = this.fish.fishingSystem; this.firstHit = true; this.ResetAllMember(); this.currentHitMoveAreaRadius = this.startHitMoveAreaRadius = this.nextHitMoveAreaRadius = this.HitParam.MoveAreaMaxRadius; float num1 = this.HitParam.MoveAreaAngle / 2f; float num2 = this.HitParam.MoveAreaMaxRadius + 1f; this.fishingSystem.HitMoveArea.get_forward(); this.nextPosition = Vector3.op_Addition(this.fishingSystem.HitMoveArea.TransformDirection(Vector3.op_Multiply(Quaternion.op_Multiply(Quaternion.Euler(0.0f, Random.Range(-num1, num1), 0.0f), Vector3.get_forward()), num2)), this.fishingSystem.HitMoveArea.get_position()); this.startPosition = ((Component)this).get_transform().get_position(); Vector3 vector3 = Vector3.op_Subtraction(this.nextPosition, this.startPosition); this.firstHitUseTime = ((Vector3) ref vector3).get_magnitude() / this.HitParam.MoveSpeed; this.firstTimeLimit = this.firstHitUseTime + this.HitParam.AngleMinTimeLimit; }
private void SetGetFishUI(FishInfo _info) { if (!Singleton <Manager.Map> .IsInstance()) { return; } FishingManager fishingSystem = Singleton <Manager.Map> .Instance.FishingSystem; this.getFishInfo = _info; this.DestroyGetFishModel(); Resources.FishingTable fishing = Singleton <Resources> .Instance.Fishing; Dictionary <int, Tuple <GameObject, RuntimeAnimatorController> > fishModelTable = fishing.FishModelTable; Renderer renderer = (Renderer)null; float num1 = -50f; int modelId = _info.ModelID; Tuple <GameObject, RuntimeAnimatorController> tuple; if (fishModelTable.TryGetValue(modelId, out tuple) && Object.op_Inequality((Object)tuple.Item1, (Object)null)) { this.getFishModel = (GameObject)Object.Instantiate <GameObject>((M0)tuple.Item1, new Vector3(0.0f, num1, 0.0f), Quaternion.get_identity()); this.getFishModel.get_transform().SetParent(fishingSystem.RootObject.get_transform(), true); this.SetLayer(this.getFishModel.get_transform(), LayerMask.NameToLayer("Fishing")); Animator componentInChildren = (Animator)this.getFishModel.GetComponentInChildren <Animator>(true); if (Object.op_Inequality((Object)componentInChildren, (Object)null) && Object.op_Inequality((Object)tuple.Item2, (Object)null)) { componentInChildren.set_runtimeAnimatorController(tuple.Item2); } renderer = (Renderer)this.getFishModel.GetComponentInChildren <Renderer>(true); } Camera fishModelCamera = fishingSystem.fishModelCamera; if (Object.op_Inequality((Object)renderer, (Object)null)) { float num2 = fishModelCamera.get_nearClipPlane() + 5f; Bounds bounds = renderer.get_bounds(); Vector3 center = ((Bounds) ref bounds).get_center(); ref Vector3 local = ref center; local.x = (__Null)(local.x - ((double)num2 + ((Bounds) ref bounds).get_extents().x)); ((Component)fishModelCamera).get_transform().set_position(center); ((Component)fishModelCamera).get_transform().set_rotation(Quaternion.Euler(0.0f, 90f, 0.0f)); fishModelCamera.set_orthographic(true); float num3 = Mathf.Max((float)((Bounds) ref bounds).get_extents().z, (float)((Bounds) ref bounds).get_extents().y); fishModelCamera.set_orthographicSize(Mathf.Max(num3, fishing.ResultFishReferenceExtent) * 1.2f); }
private void WaterBuoyancyUpdate() { Vector3 vector3 = Vector3.op_Division(this.CalculateMaxBuoyancyForce(), (float)this.voxels.Count); Bounds bounds = this.m_collider.get_bounds(); float num1 = (float)((Bounds) ref bounds).get_size().y *this.Param.NormalizedVoxelSize; float num2 = 0.0f; for (int index = 0; index < this.voxels.Count; ++index) { Vector3 _checkPos = ((Component)this).get_transform().TransformPoint(this.voxels[index]); Vector3 _hitPoint; float num3 = Mathf.Clamp((float)((!FishingManager.CheckOnWater(_checkPos, out _hitPoint) ? (double)(float)this.fishingSystem.MoveArea.get_transform().get_position().y : (double)(float)_hitPoint.y) - _checkPos.y + (double)num1 / 2.0) / num1, 0.0f, 1f); num2 += num3; this.m_rigidbody.AddForceAtPosition(Quaternion.op_Multiply(Quaternion.Slerp(Quaternion.FromToRotation(((Component)this.waterCollider).get_transform().get_up(), Vector3.get_up()), Quaternion.get_identity(), num3), Vector3.op_Multiply(vector3, num3)), _checkPos); } float num4 = num2 / (float)this.voxels.Count; this.m_rigidbody.set_drag(Mathf.Lerp(this.initialDrag, this.Param.DragInWater, num4)); this.m_rigidbody.set_angularDrag(Mathf.Lerp(this.initialAngularDrag, this.Param.AngularDragInWater, num4)); }
private void OnEnable() { _player.SucceedFishing = null; _fish = GameObject.FindWithTag("Fish").GetComponent <FishingManager>(); }
public void StartHit() { this.fishingSystem = this.fish.fishingSystem; this.InitializeFirst(); }
void Awake() { SharedInstance = this; spawnInitialFish(); }
// Start is called before the first frame update void Start() { InitFish(); fishingManager = GameObject.Find("Game").GetComponent <FishingManager>(); }
public virtual void Start() { fishingManager = GameObject.Find("Game").GetComponent <FishingManager>(); }
// Start is called before the first frame update void Start() { lure = GameObject.Find("Lure").GetComponent <Lure>(); fishingManager = GameObject.Find("Game").GetComponent <FishingManager>(); }
// Start is called before the first frame update void Start() { startPosition = transform.position; fishingManager = GameObject.Find("Game").GetComponent <FishingManager>(); lureTarget = GameObject.Find("LureTarget").GetComponent <LureTarget>(); }