public void ReadyUp() { if (trackedMonster == BC.player) { playerController.currentUserState = PlayerController.PlayerState.READY; currentState = GaugeState.INCREASING; } }
void Awake() { BC = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <BattleController>(); state = GaugeState.INCREASING; GameObject tickWindow = GameObject.FindGameObjectWithTag("TickWindow"); transform.SetParent(tickWindow.transform); rectTransform = GetComponent <RectTransform>(); transform.localPosition = new Vector2(windowMinBound, 0); }
void ComputeIdle() { //get percentage total assuming our threshold is 100 idlePercentage = (monsterController.currentSpeed / BC.threshold) * 100f; //if we are not ready (at 100%) then keep incrementing position of tick if (idlePercentage <= 100.0f) { //apply percentage in relation to the area of interest (our wait area from -250 to 250) positionX = windowMinBound + idlePercentage * (rangeWaitBound / 100.0f); transform.localPosition = new Vector2(positionX, positionY); } else { state = GaugeState.STOP; return; } }
// Update is called once per frame void Update() { gaugeTimer += Time.deltaTime; if (gaugeTimer >= decrementSpeedSeconds) { gaugeTimer = 0; GaugeDecrease(); } if (currentAmount <= 25) { currentState = GaugeState.LOW; } if (currentAmount > 25 && currentAmount < 75) { currentState = GaugeState.MID; } if (currentAmount >= 75) { currentState = GaugeState.HIGH; } }
public void ChangeState(GaugeState state) { done = false; this.state = state; }