public void Update() { OrbbecManager refOrbbecManager = OrbbecManager.Instance; if (refOrbbecManager == null) { return; } if (!refOrbbecManager.IsTrackingHand(HandID)) { return; } if (!refOrbbecManager.GetHandInfo(HandID, ref info)) { return; } Point3D.Point3ToVec3(ref m_OriginHandsPos, ref info.OriginHandsPos); Point3D.Point3ToVec3(ref m_CurHandsPos, ref info.CurHandsPos); Point3D.Point3ToVec3(ref m_CurScreenPercent, ref info.ScreenPercent); CurCatchState = refOrbbecManager.GetHandCatchState(HandID); }
public async Task Handle(ISession session, WebSocketSession webSocketSession, dynamic message) { CatchState.AddFastPokemapItem(message.Data); await HumanWalkSnipeTask.AddFastPokemapItem(message.Data); //Console.WriteLine(JsonConvert.DeserializeObject(message.Data)); }
public void InitStateMachine(BearController ber) { base.InitStateMachine(); startState = new StartState(this, ber); patrolState = new PatrolState(this, ber); travelToPooPlaceState = new TravelToPooPlaceState(this, ber); poopGoldState = new PoopGoldState(this, ber); lookConcernedState = new LookConcernedState(this, ber); chaseState = new ChaseState(this, ber); catchState = new CatchState(this, ber); molestState = new MolestState(this, ber); currentState = startState; currentState.EnterState(); }
void Nibble() { if (Vector3.Distance(transform.position, Rod.instance.bobber.transform.position) > 0.5f) { fishState = FishState.seeBait; } float step = Time.deltaTime * moveSpeed * 5f; Vector3 newPos = Rod.instance.bobber.transform.position; newPos.y = 0; transform.position = Vector3.MoveTowards(transform.position, newPos, step); Vector3 newDir = Vector3.RotateTowards(transform.forward, transform.position - newPos, 0.06f, 0.0f); newDir.y = 0; transform.rotation = Quaternion.LookRotation(newDir); if (InputManager.instance.clickState == InputManager.ClickStates.press) { if (Random.Range(0, 5) == 0) { //What happens when fish takes the bait fishState = FishState.gotcha; catchState = CatchState.fishPulls; transform.SetParent(Rod.instance.bobber.transform); } else { if (Random.Range(0, 6) == 0) { fishState = FishState.neutral; } } } }
void Gotcha() { transform.localPosition = Vector3.zero; switch (catchState) { case CatchState.youPull: Rod.instance.fishPullsBack = false; if (!mouseIsMoving) { if (Random.Range(0, 6) == 0) { catchState = CatchState.fishPulls; fishPullStrenght = 40; } } break; case CatchState.fishPulls: Rod.instance.fishPullsBack = true; //Fish Reels freely if (InputManager.instance.clickState != InputManager.ClickStates.hold) { float step = Time.deltaTime * moveSpeed * 4; Vector3 newPos = Rod.instance.transform.position; newPos.y = 0; Transform bobberTr = Rod.instance.bobber.transform; bobberTr.position = Vector3.MoveTowards(bobberTr.position, bobberTr.position - newPos, step); Vector3 newDir = Vector3.RotateTowards(transform.forward, transform.position - newPos, 0.06f, 0.0f); newDir.y = 0; transform.rotation = Quaternion.LookRotation(newDir); } //Player Fights the fish else if (playerPullStrenght > 0) { if (mouseIsMoving) { fishPullStrenght -= 5 - fishStrenghtLevel * Time.deltaTime; } else { float step = Time.deltaTime * moveSpeed * 2; Vector3 newPos = Rod.instance.transform.position; newPos.y = 0; Transform bobberTr = Rod.instance.bobber.transform; bobberTr.position = Vector3.MoveTowards(bobberTr.position, bobberTr.position - newPos, step); Vector3 newDir = Vector3.RotateTowards(transform.forward, transform.position - newPos, 0.06f, 0.0f); newDir.y = 0; transform.rotation = Quaternion.LookRotation(newDir); //lisää että pelaajan ongen heiluttelu vähentäisi kalan strenght playerPullStrenght -= 1 * Time.deltaTime; } } if (fishPullStrenght < 0.01f) { catchState = CatchState.youPull; } break; } }
void Start() { CatchState = CatchState.WaitForCatch; _radialTimerRenderer.material.SetFloat("_Fraction", 1f); }