//method that moves a single gridtoken around the scene //moves characters one tile at a time, going through a list of positions public void MoveGridToken() { _currTime = (Time.time - _startTime) / _moveSpeed; if (_currTime > 1) { _currTime = 1; //Debug.Log("current move, " + _currTileMoves.Count); _currMoveToken.transform.position = _currTileMoves[1].transform.position; _currTileMoves.RemoveAt(0); _startTime = Time.time; //Debug.Log("after move, " + _currTileMoves.Count); if (_currTileMoves.Count <= 1) { GameUpdate.ObjectSubscribe -= MoveGridToken; Debug.Log("ending movement"); _batRef.CharacterDoneMoving(_currTileMoves[0].PersonOnMe); return; } _currTime = 0; } //Debug.Log(_currTileMoves[0].PersonOnMe); // Debug.Log(_currTileMoves[1].PersonOnMe); if (_currTileMoves.Count > 1) { _currMoveToken.transform.position = RandomThings.Interpolate(_currTime, _currTileMoves[0].transform.position, _currTileMoves[1].transform.position); } }
public void FadeOutUI() { _fadeCurrTime = (Time.time - _startTime) / (_moveFadeSpeed * 2); if (_fadeCurrTime >= 1) { GameUpdate.UISubscribe -= FadeOutUI; Debug.Log("ending done"); UIHolder.UIInstance.ResetToTeamSelect(); } _endImage.alpha = RandomThings.Interpolate(_fadeCurrTime, 1, 0); }
public void MoveUI() { _moveCurrTime = (Time.time - _startTime) / _moveFadeSpeed; if (_moveCurrTime > 1) { _myRect.localPosition = _movePos; _currPos = _myRect.localPosition; _moving = false; GameUpdate.UISubscribe -= MoveUI; } _myRect.localPosition = RandomThings.Interpolate(_moveCurrTime, _currPos, _movePos); }
public void FadeOutUI() { _fadeCurrTime = (Time.time - _startTime) / _moveFadeSpeed; if (_fadeCurrTime > 1) { _mainPanel.alpha = 0; _mainPanel.blocksRaycasts = false; _hidden = true; GameUpdate.UISubscribe -= FadeOutUI; } _mainPanel.alpha = RandomThings.Interpolate(_fadeCurrTime, _mainPanel.alpha, 0); }
//IFadeable Interface //Fades in UI to full alpha public void FadeInUI() { _fadeCurrTime = (Time.time - _startTime) / _moveFadeSpeed; if (_fadeCurrTime >= 1) { _abilityMenu.alpha = 1; _abilityMenu.blocksRaycasts = true; _hidden = false; _moving = false; GameUpdate.UISubscribe -= FadeInUI; } _abilityMenu.alpha = RandomThings.Interpolate(_fadeCurrTime, _abilityMenu.alpha, 1); }
public void FadeOutUI() { _fadeCurrTime = (Time.time - _startTime) / _speedDelta; if (_fadeCurrTime > 1) { _mainPanel.alpha = 0; _mainPanel.blocksRaycasts = false; _hidden = true; _uiRef.GetInteractionState = UIInteractions.FREE; GameUpdate.UISubscribe -= FadeOutUI; } _mainPanel.alpha = RandomThings.Interpolate(_fadeCurrTime, _mainPanel.alpha, 0); }
//called when the camers needs to focus on a certain character void MoveToPosition() { _currTime = (Time.time - _startTime) / _moveSpeed; if (_currTime > 1) { _currTime = 1; _myCurrMode = CameraModes.FREE; GameUpdate.UISubscribe -= MoveToPosition; GameUpdate.PlayerSubscribe += PlayerControl; _moving = false; //Debug.Log("Done Moving"); } //Debug.Log("moving"); transform.position = RandomThings.Interpolate(_currTime, _startPos, _targetPos); }
//called when the cmaera needs to zoom in to show detail on a character void ZoomOn() { _currTime = (Time.time - _startTime) / _zoomSpeed; //Debug.Log("zooming"); transform.position = RandomThings.Interpolate(_currTime, _startPos, _targetPos); if (_currTime > 1) { transform.position = _targetPos; _currTime = 1; _myCurrMode = CameraModes.NONE; GameUpdate.UISubscribe -= ZoomOn; _moving = false; } }
public void MoveUI() { _currTime = (Time.time - _startTime) / _speedDelta; //Debug.Log("MovingUI on"); if (_currTime > 1) { _currTime = 1; //Debug.Log("details on"); GameUpdate.UISubscribe -= MoveUI; } //move UI on screen Vector3 newPos = _myRect.anchoredPosition; newPos.x = RandomThings.Interpolate(_currTime, _myRect.anchoredPosition.x, _movePos.x); _myRect.anchoredPosition = newPos; }
void MoveUp() { _currTime = (Time.time - _startTime) / _fadespeed; _group.alpha = RandomThings.Interpolate(_currTime, 1, 0); Vector3 movepos = UIHolder.UIInstance.GetBattleUI.BattleCamera.WorldToScreenPoint(_objectWorldPos); movepos += (Vector3.up * _movespeed) * _currTime; _myRect.position = movepos; if (_currTime >= 1) { GameUpdate.UISubscribe -= MoveUp; Destroy(this.gameObject); Debug.Log("text destroyed"); } }