public void OnGame() { if (TargetMachine.instance.AllTargetsDie()) { nextClubState = ClubState.RESULT; } }
public void OnReady() { Ray ray = DataManager.instance.playerCamera.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0f)); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { if (hit.transform.gameObject.name == "GazeTrigger") { progressBar.fillAmount += 1f / readyTextTime * Time.deltaTime; } else { progressBar.fillAmount = 0f; } } if (progressBar.fillAmount >= 1f) { DataManager.instance.isReadyTextShowed[(int)currentClub] = true; } if (readyText.IsActive() && DataManager.instance.isReadyTextShowed[(int)currentClub]) { readyText.gameObject.SetActive(false); startText.gameObject.SetActive(true); } if (startText.IsActive() && DataManager.instance.isStartTextShowed[(int)currentClub]) { nextClubState = ClubState.GAME; } }
public void OnReturning() { if (DataManager.instance.isInReadyZone[(int)currentClub]) { ExitReturning(); nextClubState = ClubState.READY; } }
/* Change State Functions */ private void ChangeClubState() { clubStateExits[currentClubState](); clubStateInits[nextClubState](); currentClubState = nextClubState; }
/* Club States Methods */ public void InitIdle() { timer = 0f; welcomeText.gameObject.SetActive(true); StartCoroutine(Timer.StartTimer(welcomeTextTime, () => { nextClubState = ClubState.WAITING; })); }
void Awake() { if (instance != null) { Destroy(instance.gameObject); } instance = this; }
private static void PlayerPatch(On.Player.orig_ctor orig, Player player, AbstractCreature abstractCreature, World world) { orig(player, abstractCreature, world); int playerNumber = player.playerState.playerNumber; if (playerNumber >= totalPlayerNum) { Debug.Log("Extra slugcats detected: " + playerNumber); MoreSlugcat(playerNumber); } clubStats[playerNumber] = new ClubState { swingDelay = 0, swingTimer = 0, comboCount = 0, comboCooldown = 0, firstHit = false }; bowStats[playerNumber] = new BowState { drawTime = 0.0f, aimDir = new Vector2(0, 0), lastAimDir = bowStats[playerNumber].aimDir, controlLocked = 0, isDrawing = false, released = false }; globalStats[playerNumber] = new GlobalState { headSlot = null, bodySlot = null, accessorySlot = null, backSlot = null }; switch (player.slugcatStats.name) { case SlugcatStats.Name.White: globalStats[playerNumber].meleeSkill = 1f; globalStats[playerNumber].rangedSkill = 1f; bowStats[playerNumber].arrowLethality = 1f; break; case SlugcatStats.Name.Red: globalStats[playerNumber].meleeSkill = 1.25f; globalStats[playerNumber].rangedSkill = 0.8f; bowStats[playerNumber].arrowLethality = 1.15f; break; case SlugcatStats.Name.Yellow: globalStats[playerNumber].meleeSkill = 0.75f; globalStats[playerNumber].rangedSkill = 1.45f; bowStats[playerNumber].arrowLethality = 0.85f; break; default: globalStats[playerNumber].meleeSkill = 1f; globalStats[playerNumber].rangedSkill = 1f; bowStats[playerNumber].arrowLethality = 1f; break; } bowStats[playerNumber].drawSpeed = globalStats[playerNumber].rangedSkill * 1f; }