void Start()
 {
     seekerControls.enabled = false;
     seekerShop.enabled     = false;
     gameTime = new GameTimeManager(15, gameRoundTime, 10);
     gameTime.startGame();
 }
Ejemplo n.º 2
0
    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>();
            }
Ejemplo n.º 4
0
    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);
        }
    }
Ejemplo n.º 5
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Ejemplo n.º 6
0
 public static void SetTimeManager(GameTimeContorl contorl)
 {
     if (TimeManager == null)
     {
         TimeManager = new GameTimeManager();
         TimeManager.SetTimeContorl(contorl);
     }
 }
Ejemplo n.º 7
0
    private void Awake()
    {
        if (instance != this)
        {
            Destroy(instance);
        }

        instance = this;
    }
Ejemplo n.º 8
0
    public void PlayCapture(Vector3 pos)
    {
        if (!GameTimeManager.Get().CheckTimer(TimerType.T_Capture))
        {
            return;
        }
        float pan = GetAudioPan(pos);

        PlayAudioEffect("capture", 1.0f, pan);
    }
Ejemplo n.º 9
0
 internal void SlowMotion()
 {
     if (GameStatusEffect.SlowMotionIsReady)
     {
         GameTimeManager.SlowMotionTimeStart(SlowMotionTimer_Tick);
         GameTimeManager.SlowMotionCooldownStart(SlowMotionCooldown_tick);
         GameStatusEffect.SlowMotionIsReady = false;
         SetSpeed(GameStatusEffect.SlowMotionSpeed);
     }
 }
Ejemplo n.º 10
0
 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>();
 }
Ejemplo n.º 11
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 12
0
    public void PlayWarp(Vector3 pos)
    {
        if (!GameTimeManager.Get().CheckTimer(TimerType.T_Warp))
        {
            return;
        }

        float pan = GetAudioPan(pos);

        PlayAudioEffect("warp", 0.7f, pan);
    }
Ejemplo n.º 13
0
    public void PlayLaser(Vector3 pos)
    {
        if (!GameTimeManager.Get().CheckTimer(TimerType.T_Laser))
        {
            return;
        }

        float pan = GetAudioPan(pos);

        PlayAudioEffect("laser", 1.0f, pan);
    }
Ejemplo n.º 14
0
    public void PlayJumpEnd(Vector3 pos)
    {
        if (!GameTimeManager.Get().CheckTimer(TimerType.T_JumpEnd))
        {
            return;
        }

        float pan = GetAudioPan(pos);

        PlayAudioEffect("jumpEnd", 0.6f, pan);
    }
Ejemplo n.º 15
0
            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));
            }
Ejemplo n.º 16
0
    void Start()
    {
        timeManager    = GetComponent <GameTimeManager>();
        playerProvider = GetComponent <PlayerProvider>();
        enemyProvider  = GetComponent <EnemyProvider>();

        CurrentState.Subscribe(state =>
        {
            //state.Red();
            OnStateChanged(state);
        });
    }
Ejemplo n.º 17
0
        //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();
        }
Ejemplo n.º 18
0
    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");
        }
    }
Ejemplo n.º 19
0
    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();
    }
Ejemplo n.º 20
0
 // 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;
 }
Ejemplo n.º 22
0
 public void Start()
 {
     gameTime = GameObject.FindGameObjectWithTag("rspTime").GetComponent <GameTimeManager>();
 }
Ejemplo n.º 23
0
 // Start is called before the first frame update
 void Start()
 {
     _actionController = GameMaster.Find <ActionController>();
     _timeManager      = GameMaster.Find <GameTimeManager>();
     _battleManager    = GameMaster.Find <BattleManager>();
 }
Ejemplo n.º 24
0
 void SlowMotionTimer_Tick(object sender, EventArgs e)
 {
     GameTimeManager.SlowMotionTimeStop();
     SetSpeed(GameSettings.BallBaseSpeed);
 }
Ejemplo n.º 25
0
 void SlowMotionCooldown_tick(object sender, EventArgs e)
 {
     GameTimeManager.SlowMotionCoolDownStop();
 }
Ejemplo n.º 26
0
 public void Init(GameTimeManager Manager)
 {
     TimeManager = Manager;
 }
Ejemplo n.º 27
0
 private void OnEnable()
 {
     _timeManager = GameObject.Find("GameMaster").GetComponent <GameTimeManager>();
     _timeManager.Register(this);
 }
Ejemplo n.º 28
0
 // Start is called before the first frame update
 void Start()
 {
     _enemy       = GameMaster.Find <EnemyScript>();
     _timeManager = GameMaster.Find <GameTimeManager>();
     _initialX    = _enemyImage.transform.position.x;
 }
Ejemplo n.º 29
0
 public GameTimeManager()
 {
     GameTime = this;
 }
Ejemplo n.º 30
0
 void Start()
 {
     asource = this.GetComponent <AudioSource>();
     gtm     = GameTimeManager.GameTime;
 }