Beispiel #1
0
 private void DisableSound(STAGE stage)
 {
     if (stage == STAGE.END)
     {
         isOver = true;
     }
 }
    // Update is called once per frame
    void Update()
    {
        switch (stage)
        {
        case STAGE.START:
            appearVortex.transform.localScale = Vector3.zero;
            topVortex.transform.localScale    = Vector3.zero;
            bottomVortex.transform.localScale = Vector3.zero;

            targetSpritePos           = sprite.transform.position;
            sprite.transform.position = targetSpritePos - new Vector3(1f, 0, 0);

            cachedCamPos = Camera.main.transform.position;

            stage = STAGE.APPEAR;
            break;

        case STAGE.APPEAR:
            stageTime += Time.deltaTime;
            if (stageTime < appearDuration)
            {
                float t = stageTime / appearDuration;

                appearVortex.transform.localScale = Vector3.one * (1f - Mathf.Pow(1 - t, 2));
                topVortex.transform.localScale    = Vector3.one * (Mathf.Pow(t, 2));
                bottomVortex.transform.localScale = Vector3.one * (Mathf.Pow(t, 2));

                sprite.transform.localScale = spriteScale * (0.5f - 0.5f * Mathf.Cos(Mathf.PI * t));
                sprite.transform.position   = targetSpritePos - new Vector3(1f - 1f * t, 0, 0);

                // screenshake
                Camera.main.transform.position = cachedCamPos + screenShakeStrength * (0.5f - Mathf.Abs(t - 0.5f)) * new Vector3(Mathf.Sin(50 * t), Mathf.Sin(63 * t));
                appearDuration = appearDuration / 2;     //each appear is faster
            }
            else
            {
                appearVortex.transform.localScale = Vector3.one;
                topVortex.transform.localScale    = Vector3.one;
                bottomVortex.transform.localScale = Vector3.one;

                sprite.transform.localScale = spriteScale;
                sprite.transform.position   = targetSpritePos;

                stageTime = 0;

                boxCollider.enabled = true;
                stage = STAGE.HUNT;
            }
            break;

        case STAGE.HUNT:
            stageTime += Time.deltaTime;
            sprite.transform.localPosition = new Vector3(moveAmplitude * Mathf.Sin(moveSpeed * stageTime), 0f, -1f);
            break;

        case STAGE.CATCH:
            // ?
            break;
        }
    }
Beispiel #3
0
    private void BackButtonController()
    {
        switch (myStage)
        {
        case STAGE.GAME_TYPE:
            if (lastBackTime <= 0)
            {
                backDialog.gameObject.SetActive(true);
                lastBackTime = 2;
            }
            else
            {
                print("Exit");
                Application.Quit();
            }

            break;

        case STAGE.GAME_CHOSE:
            GameType.Instance.Show();
            ChoseTankPanel.Instance.Hide();
            myStage = STAGE.GAME_TYPE;
            break;
        }
    }
Beispiel #4
0
        private void encode()
        {
            stage = STAGE.STG2;
            string cmd           = System.IO.Path.Combine(config.ffmpegPath, @"ffmpeg.exe");
            string videoFileName = System.IO.Path.Combine(config.outputPath, fileNameTextbox.Text);
            string argval        = String.Format("-i {0}.ts {1} {2}.mp4", videoFileName, config.ffmpegOpt, videoFileName);

            System.Console.WriteLine(argval);

            ProcessStartInfo psinfo = new ProcessStartInfo();

            psinfo.FileName               = cmd;
            psinfo.CreateNoWindow         = true;
            psinfo.UseShellExecute        = false;
            psinfo.RedirectStandardOutput = true;
            psinfo.RedirectStandardError  = true;
            psinfo.Arguments              = argval;
            Process p = Process.Start(psinfo);

            p.EnableRaisingEvents = true;
            p.SynchronizingObject = this;
            p.OutputDataReceived += OutputHandler;
            p.ErrorDataReceived  += OutputHandler;
            p.Exited += procTerminated;
            p.BeginOutputReadLine();
            p.BeginErrorReadLine();
            //           p.WaitForInputIdle();
            this.button1.Enabled = false;
        }
Beispiel #5
0
    public void nextStage()
    {
        paused = false;
        numStage++;
        if (numStage > 2)
        {
            started = false;
        }
        else
        {
            repetition    = 0;
            currentPlayer = 0;
            playerMasters[0].setRecording(true);
            playerMasters[1].setRecording(true);

            playerMasters[1].fillPlayerInformation();
            playerMasters[1].nextStage();

            if (!PhotonNetwork.isMasterClient)
            {
                int[] currSce = playerMasters[1].currentScenarioConfiguration();
                GetComponent <PhotonView>().RPC("setPosObj", PhotonTargets.All, currSce[0], currSce[1]);
            }

            playerMasters[0].fillPlayerInformation();
            playerMasters[0].nextStage();


            currenStage = stages[numStage];
            centralBannerMannaher.temporalMessage("Comenzando parte " + numStage);
            playerMasters[0].changeStage(currenStage);
            playerMasters[1].changeStage(currenStage);
        }
    }
Beispiel #6
0
    public void UpdateBoard(STAGE stage)
    {
        switch (stage)
        {
        case STAGE.FIRSTRETURN:
            stage1.SetActive(true);
            break;

        case STAGE.USBPLUGGED:
            stage2.SetActive(true);
            break;

        case STAGE.CHEMICALPUZZLE:
            stage2.SetActive(true);
            chemicalCheckMark.SetActive(true);
            break;

        case STAGE.ELEMENTPUZZLE:
            steriliseCheckMark.SetActive(true);
            break;

        default:
            return;
        }
    }
Beispiel #7
0
    public int NumberOfPlayersForEachStage(STAGE stage)
    {
        switch (stage)
        {
        case STAGE.stage1:
            return(2);

            break;

        case STAGE.stage2:
            return(1);

            break;

        case STAGE.stage3:
            return(1);

            break;

        default:
            return(1);

            break;
        }
    }
Beispiel #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            stage = STAGE.STG1;
            string cmd        = System.IO.Path.Combine(config.rtmpdumpPath, @"rtmpdump.exe");
            string fileName   = string.Format(programIDTextbox.Text + '-' + gpAuthkey + "-0-{0}", this.suffix.Value);
            string outputName = System.IO.Path.Combine(config.outputPath, fileNameTextbox.Text);
            string argval     = String.Format("-n {0} -l 0 -y \"{1}\" -o {2}.ts", config.garaponIP, fileName, outputName);

            System.Console.WriteLine(argval);

            ProcessStartInfo psinfo = new ProcessStartInfo();

            psinfo.FileName               = cmd;
            psinfo.CreateNoWindow         = true;
            psinfo.UseShellExecute        = false;
            psinfo.RedirectStandardOutput = true;
            psinfo.RedirectStandardError  = true;
            psinfo.Arguments              = argval;
            Process p = Process.Start(psinfo);

            p.EnableRaisingEvents = true;
            p.SynchronizingObject = this;
            p.OutputDataReceived += OutputHandler;
            p.ErrorDataReceived  += OutputHandler;
            p.Exited += procTerminated;
            p.BeginOutputReadLine();
            p.BeginErrorReadLine();
            //    //       p.WaitForInputIdle();
            this.button1.Enabled = false;
        }
Beispiel #9
0
 private void Start()
 {
     timeLive = maxTimeLive;
     sk.AnimationState.Complete += OnComplete;
     stage         = STAGE.Begin;
     boneBarrelGun = sk.Skeleton.FindBone(strboneBarrelGun);
 }
Beispiel #10
0
    // Start is called before the first frame update
    void Start()
    {
        repetition = 0;

        currenStage = STAGE.TUTORIAL;
        numStage    = 0;
    }
Beispiel #11
0
        public virtual void RecoverFreeSpin(Dictionary <string, string> dataList, int iBetAmount = 0)
        {
            m_Stage = STAGE.STAGE_FREESPIN;
            int      id           = int.Parse(dataList["SLOTID"]);
            SlotReel FreespinReel = m_SlotReels[id];

            if (dataList.ContainsKey("FGRS") && !string.IsNullOrEmpty(dataList["FGRS"].Trim()))
            {
                m_SpinResult = m_SlotReels[0].PlayGame(iBetAmount);
                int[] reelstops = StringUtility.StringToIntArray(dataList["FGRS"], ' ');
                FreespinReel.Recover(reelstops, iBetAmount);

                int iCurrentSpin = int.Parse(dataList["CURRENTSPIN"]);
                int iFSTotalWin  = int.Parse(dataList["FSTOTALWIN"]);
                int iTotalSpin   = int.Parse(dataList["TOTALSPIN"]);
                m_SpinResult.ClearTiggerLine();
                m_SpinResult.ReadyForSpin = true;
                m_SpinResult.setBonusId(0, 0, 0);
                m_SpinResult.FreePlay      = true;
                m_SpinResult.BaseWinAmount = int.Parse(dataList["BGWINAMOUNT"]);
                FreespinReel.RestoreFreeSpinProperties(iCurrentSpin, iTotalSpin, iFSTotalWin);
                m_SpinResult.FreeSpinProp = FreespinReel.getFreeSpinProperties();
            }
            else
            {
                m_bRecover = true;
                int[] reelstops = StringUtility.StringToIntArray(dataList["BGRS"], ' ');
                m_SlotReels[0].Recover(reelstops, iBetAmount);
                m_Stage = STAGE.STAGE_IDLE;
            }
        }
Beispiel #12
0
 private void StartGame()
 {
     if (numberOfPlayers == NumberOfPlayersForEachStage(currentStage))
     {
         IsStarted  = true;
         nextStages = currentStage + 1;
     }
 }
Beispiel #13
0
 private void Update()
 {
     //currentStage = stage.ToString();
     if (p_stage != Stage)
     {
         Stage = p_stage;
     }
 }
Beispiel #14
0
 public void setStage(STAGE stage)
 {
     if (transform.GetChild(0).gameObject.activeSelf == false)
     {
         _stage = stage;
         transform.GetChild(0).gameObject.SetActive(true);
         transform.Find(STAGE_NAME[( int )_stage]).gameObject.SetActive(true);
     }
 }
Beispiel #15
0
    public void OnEnable()
    {
        rigid.bodyType = RigidbodyType2D.Kinematic;

        stage = STAGE.stand;

        // ko thấy hàm nào làm ranger inactive cả, nhưng lâu lâu nó bị
        ranger.SetActive(true);
    }
Beispiel #16
0
    void Die()
    {
        stage = STAGE.dead;

        animator.Play("red_dead");

        GameController.ScoreAdd(1);
        GameController.SoundPain();
    }
Beispiel #17
0
 public void getStared(string nId)
 {
     currenStage  = STAGE.TUTORIAL;
     numStage     = 0;
     experimentId = nId;
     started      = true;
     setPlayers();
     initialObjectPosition();
     centralBannerMannaher.temporalMessage("Tutorial...");
 }
Beispiel #18
0
    public void Attack()
    {
        if (stage == STAGE.dead)
        {
            return;
        }

        stage = STAGE.attack;
        animator.Play("red_strike");
    }
Beispiel #19
0
 public void Progress(STAGE stage)
 {
     if (OnProgress != null)
     {
         OnProgress(stage);
     }
     else
     {
         Debug.LogError("OnProgress is Null");
     }
 }
Beispiel #20
0
    public void OpenScene(STAGE stage)
    {
        prevStage = myStage;
        if (iAnim == null)
        {
            iAnim = IAnim(stage);
            StartCoroutine(iAnim);
        }

        myStage = stage;
    }
 void StageOneUpdate()
 {
     Debug.Log("Stage One");
     player.GetAgent().SetDestination(player.transform.position);
     if (timer >= stageOneTime) {
         currentStage = STAGE.STAGE_TWO;
         timer = 0.0f;
     }
     MainCamera.transform.position = Vector3.Lerp(MainCamera.transform.position, cameraStopTransform.position, cameraMoveSpeed);
     player.GetAgent().Stop();
 }
Beispiel #22
0
        public Form1()
        {
            InitializeComponent();
            stage = STAGE.STGIDLE;

            // イベントハンドラの追加
            WinPcap.OnRecv += new WinPcap.OnRecvHandler(OnRecv);

            config = new Config();
            loadConfig();
        }
Beispiel #23
0
    void Start()
    {
        currStage   = STAGE.BlackBG;
        headerStage = HEADER.MoveDown;
        scaleTimer  = 2.5f;
        fadeOut     = false;
        fadeToMenu  = false;

        playerIcon1.GetComponent <Image>().sprite = IconManager.Instance.GetIcon((Defines.ICONS)GlobalScript.Instance.iconP1);
        playerIcon2.GetComponent <Image>().sprite = IconManager.Instance.GetIcon((Defines.ICONS)GlobalScript.Instance.iconP2);
        playerName1.GetComponent <Text>().text    = GlobalScript.Instance.nameP1;
        playerName2.GetComponent <Text>().text    = GlobalScript.Instance.nameP2;
    }
Beispiel #24
0
 void Live(float deltaTime)
 {
     if (stage != STAGE.Normal)
     {
         return;
     }
     timeLive -= deltaTime;
     if (timeLive <= 0)
     {
         sk.AnimationState.SetAnimation(0, die, true);
         stage = STAGE.Die;
     }
 }
    public void AgeChild(STAGE childStage)
    {
        myStage = childStage;
        switch (childStage)
        {
        case STAGE.BABY:  spriteRenderer.sprite = baby; break;

        case STAGE.TODDLER: spriteRenderer.sprite = toddler; break;

        case STAGE.CHILD: spriteRenderer.sprite = child; break;

        case STAGE.TEEN: spriteRenderer.sprite = teen; break;
        }
    }
 void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player")) {
         Debug.Log("Player Entered");
         if (!triggered) {
             currentStage = STAGE.STAGE_ONE;
             triggered = true;
             player.enabled = false;
             player.movementEnabled = false;
             player.GetAgent().Stop();
             cameraInitialPosition = MainCamera.transform.position;
             MainCamera.GetComponent<CameraFollow>().enabled = false;
         }
     }
 }
Beispiel #27
0
 public virtual void GameResults(SpinResult e)
 {
     //base.GameResults(e);
     if (m_Stage == STAGE.STAGE_FREESPIN)
     {
         if (!m_SpinResult.FreePlay)
         {
             m_Stage               = STAGE.STAGE_IDLE;
             m_CurrentSlotReel     = m_SlotReels[0];
             m_SpinResult.FreePlay = false;
         }
         m_SpinResult.ReadyForSpin = ReadyForSpin();//true;
     }
     m_GameResult?.Invoke(e);
 }
Beispiel #28
0
 /// <summary>
 /// ステージを生成する処理
 /// </summary>
 /// <param name="_stageSelect"></param>
 public void CreateStage(STAGE _stageSelect)
 {
     //switch(_stageSelect)
     //{
     //    case STAGE._01:
     //        Instantiate(stages[0], Vector3.zero, Quaternion.identity);              // Stageを生成
     //        SoundMgr.Instance.PlayBgm("MainBGM");                                   // MainBGM再生
     //        break;
     //    case STAGE._02:
     //        break;
     //    case STAGE._03:
     //        break;
     //}
     Instantiate(stages[0], Vector3.zero, Quaternion.identity);              // Stageを生成
     SoundMgr.Instance.PlayBgm("MainBGM");                                   // MainBGM再生
 }
Beispiel #29
0
    private void BackButtonHandler()
    {
        switch (myStage)
        {
        case STAGE.HOME:
            if (lastBackTime <= 0)
            {
                backDialog.gameObject.SetActive(true);
                lastBackTime = 2;
            }
            else
            {
                Application.Quit();
            }
            break;

        case STAGE.GAME_CHOSE:
            //GameType.Instance.Show();
            //ChoseTankPanel.Instance.Hide();
            myStage = STAGE.HOME;
            ChangeStage(myStage);
            break;

        case STAGE.GAME:
            if (!Confirmation.Instance.isOpen)
            {
                GameSettings.Instance.ShowOrHide();
            }
            else
            {
                Confirmation.Instance.Hide();
                Invoke("ShowSettings", 0.3f);
            }
            break;

        case STAGE.UPGRADE:
            ChangeStage(STAGE.GAME_CHOSE);

            break;

        case STAGE.UPGRADE_MSG:
            MessageBox.Instance.Hide();
            myStage = STAGE.UPGRADE;
            break;
        }
    }
    //Outside forces dictate what stage it is at.
    //It then calls up the relevant stage
    public void Progress(STAGE stage)
    {
        switch (stage)
        {
        case STAGE.START:
            GameStart();
            break;

        case STAGE.FIRSTJUMP:
            FirstJump();
            break;

        case STAGE.FIRSTRETURN:
            FirstReturn();
            break;

        case STAGE.USB:
            USB();
            break;

        case STAGE.USBRETURN:
            USBReturn();
            break;

        case STAGE.USBPLUGGED:
            USBPlugged();
            break;

        case STAGE.CHEMICALPUZZLE:
            ChemicalPuzzle();
            break;

        case STAGE.ELEMENTPUZZLE:
            ElementPuzzle();
            break;

        case STAGE.END:
            GameEnd();
            break;

        default:
            break;
        }
    }
Beispiel #31
0
        public SlotEngine()
        {
            m_BaseThread = null;
            m_ePlayType  = (ePlayType)0;
            if (m_ePlayType == ePlayType.Bingo)
            {
                m_ePlayType = ePlayType.PullTab;
            }
            m_TriggeredSlotFeatures = new Queue <SlotFeature>();
            m_SpinResult            = new SpinResult();
            m_BonusList             = new List <Bonus>();
            RNG.Random.CreateRandom();
            // m_sMarketType = "general";

            m_Stage        = STAGE.STAGE_IDLE;
            m_RecoveryData = null;
            m_bRecover     = false;
            m_SlotReels    = new Dictionary <int, SlotReel>();
        }
Beispiel #32
0
 private void Move(float deltaTime)
 {
     if (stage == STAGE.Die)
     {
         return;
     }
     if (stage == STAGE.Begin)
     {
         transform.position = Vector2.MoveTowards(transform.position, posFollowPlayer(), deltaTime * 2);
         if (transform.position.y >= posFollow.y)
         {
             stage = STAGE.Normal;
         }
     }
     else
     {
         transform.position = Vector2.Lerp(transform.position, posFollowPlayer(), deltaTime * 2);
     }
 }
 void StageTwoUpdate()
 {
     Debug.Log("Stage Two");
     player.GetAgent().SetDestination(player.transform.position);
     player.GetAgent().Stop();
     if (timer >= stageTwoTime) {
         currentStage = STAGE.STAGE_FINISH;
         timer = 0.0f;
     }
 }
Beispiel #34
0
 // ページをめくる(前ページへ)
 void TurnThePageReturn()
 {
     switch (stage)
     {
         case STAGE.STAGE_2:
             stage = STAGE.STAGE_1;
             chapter = Chapter.CHAPTER_1;
             drawCount = 0;
             break;
         case STAGE.STAGE_3:
             stage = STAGE.STAGE_2;
             chapter = Chapter.CHAPTER_1;
             drawCount = 0;
             break;
         case STAGE.STAGE_4:
             stage = STAGE.STAGE_3;
             chapter = Chapter.CHAPTER_1;
             drawCount = 0;
             break;
         case STAGE.STAGE_5:
             stage = STAGE.STAGE_4;
             chapter = Chapter.CHAPTER_1;
             drawCount = 0;
             break;
     }
 }
Beispiel #35
0
    // 初期化
    void Start()
    {
        posibleKeyDown = false;
        posibkeCount = 0;

        keyFlag = false;
        CameraFade.StartAlphaFade(Color.black, true, 1.0f, 0.5f);

        switch(PlayerPrefs.GetInt("STAGE_SELECT_STAGE_NUM"))
        {
            case 1: stage = STAGE.STAGE_1; break;
            case 2: stage = STAGE.STAGE_2; break;
            case 3: stage = STAGE.STAGE_3; break;
            case 4: stage = STAGE.STAGE_4; break;
            case 5: stage = STAGE.STAGE_5; break;
        }
        chapter = Chapter.CHAPTER_1;
        startFlag = false;

        resetFlag = false;

        count = 0;
        drawFlag = false;
        drawCount = 0;

        // ファイルが存在する
        if (File.Exists("Assets/StageSelect/SaveData.txt")){ print("FILE"); }
        ReadFile(); // ファイルの読み込み

        CreateIcon();
        CreateStamp();  // スタンプの生成
    }