public void reset() { originalAtkSpeedRate.Set(1); originalMoveSpeedRate.Set(1); atkRange.Set(0); atkSpeed.Set(0); atkPhysic.Set(0); atkMagic.Set(0); defPhysic.Set(0); defMagic.Set(0); spRecovery.Set(0); mpRecovery.Set(0); speed.Set(0); summonSpPercent.Set(0); unitHpUp.Set(0); unitDefUp.Set(0); skillMpDiscount.Set(0); skillAtkUp.Set(0); skillUp.Set(0); skillTimeUp.Set(0); monsterType = Monster.TYPE.NONE; playerType = PlayerType.NotPlayer; baseLevel.Set(0); reinforceLevel.Set(1); maxHp.Set(0); }
protected void updateRecoveryData() { #if UNITY_EDITOR if (UnitSkillCamMaker.instance.useUnitSkillCamMaker) { _recoveryDelay = 5; } #endif _recoveryDelay.Set(_recoveryDelay + GameManager.globalDeltaTime); if (_recoveryDelay >= GameManager.info.setupData.recoveryDelay) { _recoveryDelay.Set(_recoveryDelay - GameManager.info.setupData.recoveryDelay); //if(isPlayer) hp += hpRecovery; //else hpWithoutDisplay += hpRecovery; mp += stat.mpRecovery; sp += stat.spRecovery; } }
//======================================================================================= public void resetCoolTime() { if (GameManager.info.setupData.tagCoolTime <= 0.1f) { state = State.Ready; coolTime.Set(0.0f); spLockImage.fillAmount = 0.0f; btn.isEnabled = true; spArrow.enabled = false; spFeverBackground.enabled = true; } else { state = State.CoolTime; coolTime = GameManager.info.setupData.tagCoolTime; spLockImage.fillAmount = 0.0f; btn.isEnabled = false; spArrow.enabled = false; spFeverBackground.enabled = false; } }
public void start(bool isPlayerBullet, Monster attacker, float totalDistanceLimit, float distanceLimitA, float distanceLimitB, int maxConnection, float connectionDelay, int damagePer, int skillLevel, int applyInforceLevel, BaseSkillData sd = null) { if (damagePer <= 0) { damagePer = 100; } if (damagePer < 100) { _damageOffsetPerConnectionLevel = ((float)damagePer) / 100.0f / (float)maxConnection; } else { _damageOffsetPerConnectionLevel = 0.0f; } isDeleteObject = false; _skillData = sd; _attacker = attacker; _delay = 0.0f; _totalDistanceLimit.Set(totalDistanceLimit); _distanceLimitA.Set(distanceLimitA); _distanceLimitB.Set(distanceLimitB); _maxConnection = maxConnection; _connectionDelay = connectionDelay; _nowConnectionNum = 0; _canMore = true; _restoreCharacterAni = false; _timeSinceBeginning = 0.0f; _isPlayerBullet = isPlayerBullet; _firstRemove = true; _nextDelay = 0.3f; _applyInforceLevel = applyInforceLevel; _skillLevel = skillLevel; getNextTarget(_isPlayerBullet); }
public void init() { // 변경 대기중인 상황인지. waitingForPlayerChange = false; waitingForPVPChange = false; // 변경시 이펙트 딜레이를 줄것인지. playerChangeDelay.Set(0.0f); pvpChangeDelay.Set(0.0f); selectPlayerIndex = 0; unSelectPlayerIndex = 1; selectPVPIndex = 0; unSelectPVPIndex = 1; // 변경 버튼을 눌렀는지. clickMyPlayerChange = false; clickPVPPlayerChange = false; // 주인공쪽 컨트롤러 황설화. GameManager.me.uiManager.uiPlay.playerControlSlots[0].gameObject.SetActive(true); GameManager.me.uiManager.uiPlay.playerControlSlots[1].gameObject.SetActive(false); for (int i = 0; i < 2; ++i) { GameManager.me.uiManager.uiPlay.playerTagSlot[i].setVisible(false); GameManager.me.uiManager.uiPlay.playerTagSlot[i].transform.parent.gameObject.SetActive(true); } for (int i = 0; i < 2; ++i) { GameManager.me.uiManager.uiPlay.pvpTagSlot[i].setVisible(false); GameManager.me.uiManager.uiPlay.pvpTagSlot[i].transform.parent.gameObject.SetActive(true); } }
void Update() { #if UNITY_EDITOR if (stageManager.isIntro) { if (Input.GetMouseButtonDown(2)) { Time.timeScale = 10.0f; } else if (Input.GetMouseButtonUp(2)) { Time.timeScale = 1.0f; } } #endif // Debug.Log("timescale: " + Time.timeScale); if (_waitForTouchToStartGame && Input.GetMouseButtonUp(0)) { _waitForTouchToStartGame = false; closeTitleAndPlayGame(); } if (uiManager.uiLoading.gameObject.activeInHierarchy == true && recordMode != RecordMode.continueGame && _openContinuePopup == false) { return; } #if UNITY_EDITOR if (Input.GetKeyUp(KeyCode.Q)) { Time.timeScale -= 0.1f; } else if (Input.GetKeyUp(KeyCode.W)) { Time.timeScale *= 2.0f; } else if (Input.GetKeyUp(KeyCode.S)) { Log.saveFileLog(); } #endif if (Time.smoothDeltaTime <= 0.0f || Time.timeScale <= 0) { globalDeltaTime = 0.0f; if (stageManager.isIntro) { cutSceneManager.updateFrame(); } return; } if (uiManager.currentUI != UIManager.Status.UI_PLAY) { if (uiManager.currentUI == UIManager.Status.UI_MENU) { // checkAutoLandScape(); } LOOP_INTERVAL.Set(Time.smoothDeltaTime); _loopType = LoopType.preview; if (Time.frameCount % 500 == 0) { System.GC.Collect(); } if (Time.frameCount % 3600 == 0) { clearMemory(); } } else { if (_isPaused) { if (Time.frameCount % 30 == 0) { System.GC.Collect(); } return; } _loopType = LoopType.inGame; LOOP_INTERVAL.Set(0.05f); ////(1.0f/20.0f); // 초당 20번 연산. if (isAutoPlay == false && BattleSimulator.nowSimulation == false) { player.moveState = Player.MoveState.Stop; } if (recordMode == RecordMode.record && isPlaying) { checkPlayerTouchForMove(); } } float newTime = currentTime + Time.smoothDeltaTime; //((float)(Mathf.RoundToInt(Time.smoothDeltaTime*100.0f))*0.01f); float frameTime = newTime - currentTime; if (frameTime > LOOP_INTERVAL * 10.0f) { frameTime = LOOP_INTERVAL * 10.0f; } #if UNITY_EDITOR if (BattleSimulator.nowSimulation && BattleSimulator.instance.skipTime > 0 && BattleSimulator.instance.skipTime > LOOP_INTERVAL) { frameTime = BattleSimulator.instance.skipTime; } #endif //if(playMode == Play_Mode.REPLAY) frameTime = 10.0f; if (recordMode == RecordMode.continueGame) { frameTime = 30.0f; } currentTime.Set(newTime); _updateLoopLeftTime.Set(_updateLoopLeftTime.Get() + frameTime); float useLoopUpdateTime = 0.0f; loopIndex = 0; while (_updateLoopLeftTime >= LOOP_INTERVAL) { globalDeltaTime = LOOP_INTERVAL; //Time.smoothDeltaTime;//Time.smoothDeltaTime; //LOOP_INTERVAL; updateLoop(); globalGamePassTime += globalDeltaTime; useLoopUpdateTime += globalDeltaTime; _updateLoopLeftTime.Set(_updateLoopLeftTime - globalDeltaTime); if (stageManager.isIntro) { #if UNITY_EDITOR Debug.Log("intro loop : " + _updateLoopLeftTime); #endif cutSceneManager.updateFrame(); if (Time.timeScale <= 0) { _updateLoopLeftTime = 0; } } ++loopIndex; } if (useLoopUpdateTime > 0) { renderSkipFrame = false; } else { renderSkipFrame = (isPlaying && uiManager.currentUI == UIManager.Status.UI_PLAY); } renderRatio = _updateLoopLeftTime / LOOP_INTERVAL; render(); globalTime = Time.realtimeSinceStartup; }