void Start() { seekerControls.enabled = false; seekerShop.enabled = false; gameTime = new GameTimeManager(15, gameRoundTime, 10); gameTime.startGame(); }
public bool Init() { LoggerSystem.Instance.Debug("BattleSystem init begin"); lockStep.frameThreshold = 3; lockStep.AddListennerLogic(FrameTick); lockStep.AddListennerPacket(FramePacketRun); string produceValue = GameVariableConfigProvider.Instance.GetData(3); string[] pros = produceValue.Split(';'); for (int i = 0; i < pros.Length; ++i) { List <float> args = Converter.ConvertNumberList <float> (pros [i]); sceneManager.AddProduce(args [0], args[1]); } battleData.Init(); sceneManager.Init(); #if !SERVER AssetManager.Get().Init(); //EffectManager.Get ().Init (); GameTimeManager.Get().Init(); #endif pause = false; bStartBattle = true; LoggerSystem.Instance.Debug("BattleSystem init end"); return(true); }
public void Init(CharacterData charData) { base.Init(); this.fgCharId = fgCharCounter++; this.charData = charData; teamId = 0; health = charData.maxHealth; fgService = GameObject.FindGameObjectWithTag("rspService").GetComponent <FightingGameService>(); inputDoNothingList = new List <Combination> { ScriptableObject.CreateInstance <DirectionCurrent>().Init(0, Input.FightingGameAbsInputCodeDir.Neutral) }; rigidbody = gameObject.GetComponent <Rigidbody>(); inUseCombinations = new List <Combination>(); onHealthChangeCallbacks = new List <Action <int, int> >(); onEmptyHealthCallbacks = new List <Action <FightingGameCharacter> >(); attackState = stateMachine.gameObject.GetComponentInChildren <CharacterStates.Attack>(); gameTimeManager = GameObject.FindGameObjectWithTag("rspTime").GetComponent <GameTimeManager>(); }
void Update() { if (isGameActive) { // Update timer if (lifetime <= 0) { Destroy(gameObject); } else { lifetime -= Time.deltaTime; } // Update movement Vector2 position = transform.position; position += direction * moveSpeed * Time.deltaTime; transform.position = position; } else { float postGameSeconds = GameTimeManager.GetInstance().finishTimeSeconds; float currentSeconds = GameTimeManager.GetInstance().GetCurrentGameTime(); transform.localScale = initialScale * (1 - (postGameSeconds - currentSeconds) / postGameSeconds); } }
void Awake() { if (instance == null) { instance = this; } }
public static void SetTimeManager(GameTimeContorl contorl) { if (TimeManager == null) { TimeManager = new GameTimeManager(); TimeManager.SetTimeContorl(contorl); } }
private void Awake() { if (instance != this) { Destroy(instance); } instance = this; }
public void PlayCapture(Vector3 pos) { if (!GameTimeManager.Get().CheckTimer(TimerType.T_Capture)) { return; } float pan = GetAudioPan(pos); PlayAudioEffect("capture", 1.0f, pan); }
internal void SlowMotion() { if (GameStatusEffect.SlowMotionIsReady) { GameTimeManager.SlowMotionTimeStart(SlowMotionTimer_Tick); GameTimeManager.SlowMotionCooldownStart(SlowMotionCooldown_tick); GameStatusEffect.SlowMotionIsReady = false; SetSpeed(GameStatusEffect.SlowMotionSpeed); } }
void Start() { _player = GameMaster.Find <PlayerScript>(); _enemy = GameMaster.Find <EnemyScript>(); _battleManager = GameMaster.Find <BattleManager>(); _gameMaster = GameMaster.Find <GameMaster>(); _timeManager = GameMaster.Find <GameTimeManager>(); _gameLog = GameMaster.Find <GameLog>(); _audioSystem = GameMaster.Find <GenericAudio>(); }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
public void PlayWarp(Vector3 pos) { if (!GameTimeManager.Get().CheckTimer(TimerType.T_Warp)) { return; } float pan = GetAudioPan(pos); PlayAudioEffect("warp", 0.7f, pan); }
public void PlayLaser(Vector3 pos) { if (!GameTimeManager.Get().CheckTimer(TimerType.T_Laser)) { return; } float pan = GetAudioPan(pos); PlayAudioEffect("laser", 1.0f, pan); }
public void PlayJumpEnd(Vector3 pos) { if (!GameTimeManager.Get().CheckTimer(TimerType.T_JumpEnd)) { return; } float pan = GetAudioPan(pos); PlayAudioEffect("jumpEnd", 0.6f, pan); }
public void Awake() { frame = GameObject.FindGameObjectWithTag("rspTime").GetComponent <FrameEnforcer>(); frame.AddUpdate((int)FramePriority.Gamemode, new Action <int>(FrameUpdate)); gameTimeManager = GameObject.FindGameObjectWithTag("rspTime").GetComponent <GameTimeManager>(); gameTimeManager.AddLayer(new Func <float, float>(GameTime), "gameTime"); EventManager.StartListening <Events.FrameEnforcerReady>(new UnityAction(EnablePlayers)); EventManager.StartListening <Events.StartGame>(new UnityAction(StartGame)); }
void Start() { timeManager = GetComponent <GameTimeManager>(); playerProvider = GetComponent <PlayerProvider>(); enemyProvider = GetComponent <EnemyProvider>(); CurrentState.Subscribe(state => { //state.Red(); OnStateChanged(state); }); }
//Constructor public GameplayScreen(int level) { TransitionOnTime = TimeSpan.FromSeconds(1.5); TransitionOffTime = TimeSpan.FromSeconds(0.5); pauseAction = new InputAction( new Buttons[] { Buttons.Start, Buttons.Back }, new Keys[] { Keys.Escape }, true); //retrieve the current level of the game this.currentLevel = level; gameTimeManager = new GameTimeManager(); }
void Update() { float gameTimeSeconds = Mathf.Ceil(GameTimeManager.GetInstance().GetCurrentGameTime()); int secondsLeft = (int)(gameTimeSeconds) % 60; int minutesLeft = (int)(gameTimeSeconds) / 60; if (GameTimeManager.GetInstance().GetGameState() == GAMESTATE.postgame) { timerText.text = "00:00"; } else { timerText.text = minutesLeft.ToString("00") + ":" + secondsLeft.ToString("00"); } }
public void Reset() { pause = false; bStartBattle = false; BeginFadeOut(); battleData.Init(); // add new init here by fangjun if (battleController != null) { battleController.Reset(); } lockStep.StopLockStep(false); sceneManager.Destroy(); battleData.Destroy(); #if !SERVER GameTimeManager.Get().Release(); Resources.UnloadUnusedAssets(); #endif System.GC.Collect(); }
// Start is called before the first frame update void Start() { _player = GameMaster.Find <PlayerScript>(); _timeManager = GameMaster.Find <GameTimeManager>(); }
public void SetManager(GameTimeManager manager) { this.manager = manager; }
public void Start() { gameTime = GameObject.FindGameObjectWithTag("rspTime").GetComponent <GameTimeManager>(); }
// Start is called before the first frame update void Start() { _actionController = GameMaster.Find <ActionController>(); _timeManager = GameMaster.Find <GameTimeManager>(); _battleManager = GameMaster.Find <BattleManager>(); }
void SlowMotionTimer_Tick(object sender, EventArgs e) { GameTimeManager.SlowMotionTimeStop(); SetSpeed(GameSettings.BallBaseSpeed); }
void SlowMotionCooldown_tick(object sender, EventArgs e) { GameTimeManager.SlowMotionCoolDownStop(); }
public void Init(GameTimeManager Manager) { TimeManager = Manager; }
private void OnEnable() { _timeManager = GameObject.Find("GameMaster").GetComponent <GameTimeManager>(); _timeManager.Register(this); }
// Start is called before the first frame update void Start() { _enemy = GameMaster.Find <EnemyScript>(); _timeManager = GameMaster.Find <GameTimeManager>(); _initialX = _enemyImage.transform.position.x; }
public GameTimeManager() { GameTime = this; }
void Start() { asource = this.GetComponent <AudioSource>(); gtm = GameTimeManager.GameTime; }