/// <summary>
    /// 右にあるボタンの押し込んだ際の処理
    /// </summary>
    public void RightScroll()
    {
        ScrollValue -= (ScrollValue > 0) ? 1 : 0;

        IconsInitialize();

        Player.Play(ChangeSoundResName);
    }
Пример #2
0
 public void Button()
 {
     if (mover.IsClosed)
     {
         Player.Play(stampCloseResName);
     }
     else
     {
         Player.Play(stampOpenResName);
     }
 }
Пример #3
0
    /// <summary>
    /// ボタン押した
    /// </summary>
    public void ButtonPlay()
    {
        if (UISelectManager.IsNoneMode)
        {
            return;
        }
        if (SEPlayer.IsPlaying(ButtonResName))
        {
            return;
        }

        SEPlayer.Play(ButtonResName);
    }
Пример #4
0
    // Update is called once per frame
    void Update()
    {
        if (TouchManager.IsPhaseTap || Input.GetMouseButtonDown(0) && !IsScreenTap)
        {
            SEPlayer.Play(TouchSoundResName);
            IsScreenTap = true;
            FairyMover.StartAnimation();
        }

        if (Alpha >= 1)
        {
            Application.LoadLevel("Story");
        }
    }
 //需要重载Input刷新函数
 //如果返回true,表示可以继续刷新后面的对象,否则刷新处理会被截断
 public override bool OnInputUpdate()
 {
     if (InputDevice.ButtonLeft && buttonGroup.IsWorkDo)
     {
         SoundEffectPlayer.Play("scroll.wav");
         if (currentSelectMapIndex > 0)
         {
             SetCurrentSelectMapIndex(currentSelectMapIndex - 1);
         }
         return(false);
     }
     else if (InputDevice.ButtonRight && buttonGroup.IsWorkDo)
     {
         SoundEffectPlayer.Play("scroll.wav");
         if (currentSelectMapIndex < maplist.Length - 1)
         {
             SetCurrentSelectMapIndex(currentSelectMapIndex + 1);
         }
         return(false);
     }
     else if (InputDevice.ButtonBack)
     {
         SoundEffectPlayer.Play("buttonok.wav");
         //闪白
         ((UiSceneUICamera)UIManager).FadeScreen();
         //进入角色选择界面
         ((UiSceneUICamera)UIManager).CreateAloneScene(UiSceneUICamera.UISceneId.Id_UIGameCharacter);
         return(false);
     }
     return(true);
 }
Пример #6
0
    private void OnDialogReback(int dialogid, GuiExtendDialog.DialogFlag ret)
    {
        switch (ret)
        {
        case GuiExtendDialog.DialogFlag.Flag_Cancel:
        {
            SoundEffectPlayer.Play("buttonok.wav");
            UnityEngine.Object.DestroyObject(this.gameObject);
        }
        break;

        case GuiExtendDialog.DialogFlag.Flag_Ok:
        {
            SoundEffectPlayer.Play("buttonok.wav");
            int currentSelectCharacterIndex = (int)m_UpgradeCharacterDt.id;
            if (m_UpgradeCharacterDt.att == UiSceneSelectGameCharacter.CharacterAttribute.AttributeA)
            {
                IGamerProfile.Instance.PayMoney(new IGamerProfile.PayMoneyData(IGamerProfile.PayMoneyItem.PayMoneyItem_LevelCharacter,
                                                                               IGamerProfile.gameCharacter.characterDataList[currentSelectCharacterIndex].LevelAToMoney.GetValue(
                                                                                   IGamerProfile.Instance.playerdata.characterData[currentSelectCharacterIndex].levelA),
                                                                               0,
                                                                               PayMoneyCallback), this);
            }
            else if (m_UpgradeCharacterDt.att == UiSceneSelectGameCharacter.CharacterAttribute.AttributeB)
            {
                IGamerProfile.Instance.PayMoney(new IGamerProfile.PayMoneyData(IGamerProfile.PayMoneyItem.PayMoneyItem_LevelCharacter,
                                                                               IGamerProfile.gameCharacter.characterDataList[currentSelectCharacterIndex].LevelBToMoney.GetValue(
                                                                                   IGamerProfile.Instance.playerdata.characterData[currentSelectCharacterIndex].levelB),
                                                                               0,
                                                                               PayMoneyCallback), this);
            }
        }
        break;
        }
    }
    private void OnButtonSelectOk(int index)
    {
        SoundEffectPlayer.Play("buttonok.wav");
        //获取最后解锁的地图
        int lastLockMapIndex = IGamerProfile.Instance.getLastLockedMap;

        if (lastLockMapIndex < currentSelectMapIndex)
        {
            SetCurrentSelectMapIndex(lastLockMapIndex);
            return;
        }

        //设置当前地图
        IGamerProfile.Instance.gameEviroment.mapIndex      = currentSelectMapIndex;
        IGamerProfile.Instance.gameEviroment.mapLevelIndex = IGamerProfile.Instance.playerdata.levelProcess[IGamerProfile.Instance.gameEviroment.mapIndex];
        if (IGamerProfile.Instance.gameEviroment.mapLevelIndex >= IGamerProfile.gameLevel.mapMaxLevel[IGamerProfile.Instance.gameEviroment.mapIndex])
        {
            IGamerProfile.Instance.gameEviroment.mapLevelIndex = IGamerProfile.gameLevel.mapMaxLevel[IGamerProfile.Instance.gameEviroment.mapIndex] - 1;
        }


        if ((GameCenterEviroment.platformChargeIntensity >= GameCenterEviroment.PlatformChargeIntensity.Intensity_VeryHigh) &&
            IGameCenterEviroment.effectCharacterLevelSale)
        {
            //让本身停止工作
            buttonGroup.IsWorkDo = false;
            LoadResource_UIPrefabs("characterlevelsale.prefab");
        }
        else
        {
            IntoGame();
        }
    }
        private void ClickRightBtEvent(InputKillVirus.ButtonState val)
        {
            if (val == InputKillVirus.ButtonState.DOWN)
            {
                return;
            }

            if (Time.time - _timeLast < _timeMax)
            {
                return;
            }

            switch (_buttonState)
            {
            case ButtonState.Back:
            {
                _buttonState = ButtonState.Restart;
                ChangeSelectButton();
                break;
            }
            }

            if (IGamerProfile.Instance != null)
            {
                SoundEffectPlayer.Play("scroll.wav");
            }
        }
    private void OnButtonSelectOk(int index)
    {
        switch (index)
        {
        case (int)ButtonId.Id_Cancel:
            SoundEffectPlayer.Play("buttonok.wav");
            GotoNext();
            break;

        case (int)ButtonId.Id_OpenOne:

            //如果所有宝箱正在开启就不要响应了
            if (!IsAllBoxOpen)
            {
                SoundEffectPlayer.Play("buttonok.wav");
                IGamerProfile.Instance.PayMoney(new IGamerProfile.PayMoneyData(IGamerProfile.PayMoneyItem.PayMoneyItem_OneTreasure,
                                                                               IGamerProfile.gameBaseDefine.gameParameter.treasure.openonce,
                                                                               0,
                                                                               PayMoneyCallback), this);
            }
            break;

        case (int)ButtonId.Id_OpenAll:

            if (!IsAllBoxOpen)
            {
                SoundEffectPlayer.Play("buttonok.wav");
                IGamerProfile.Instance.PayMoney(new IGamerProfile.PayMoneyData(IGamerProfile.PayMoneyItem.PayMoneyItem_AllTreasure,
                                                                               IGamerProfile.gameBaseDefine.gameParameter.treasure.openall,
                                                                               0,
                                                                               PayMoneyCallback), this);
            }
            break;
        }
    }
Пример #10
0
    //光头强只会和障碍物碰撞,不会吃东西
    protected override void OnTriggerEnter(Collider other)
    {
        BrokenObjectController broken = other.gameObject.GetComponent <BrokenObjectController>();

        if (broken == null)
        {
            return;
        }

        if (broken.IsLocker)
        {
            //Debug.Log(other.gameObject + "#跳出");
            return;
        }
        if (broken.brokenHandleType != BrokenObjectController.BrokenHandleType.HandleType_Barrier)
        {
            return;
        }
        //Debug.Log(other.gameObject + "#########");
        broken.IsLocker = true;
        //处理被撞物品
        broken.StartBroken(hControllerScriptCS as IParkourControllerScriptCS);
        //触发碰撞消息
        playerAIControler.OnEventHitBrokenObject();
        //播放碰撞语言
        SoundEffectPlayer.Play("touchbroken.wav");
        //playerSoundControler.PlayAudioSource(IParkourPlayerSound.PlayerSoundType.Type_Barrier);
    }
Пример #11
0
    private void OnDialogReback(int dialogid, GuiExtendDialog.DialogFlag ret)
    {
        switch (ret)
        {
        case GuiExtendDialog.DialogFlag.Flag_Cancel:
        {
            SoundEffectPlayer.Play("buttonok.wav");
            UnityEngine.Object.DestroyObject(this.gameObject);
            GuiExtendButtonGroup buttonGroup = currentCallui.GetComponent <GuiExtendButtonGroup>();
            if (buttonGroup != null)
            {
                buttonGroup.IsWorkDo = true;
            }
            //放弃充值,直接返回
            currentPayMoneyData.callbackFun(currentPayMoneyData, false);
        }
        break;

        case GuiExtendDialog.DialogFlag.Flag_Ok:
        {
            SoundEffectPlayer.Play("buttonok.wav");
            IGameCenterEviroment.currentGameCenterEviroment.OpenPlayerPayMoney(rechargeId, RechargePayCallback);
        }
        break;
        }
    }
Пример #12
0
 //触发奖励游戏币
 public static void RewardPlayerCoins(int coins, IParkourPlayer_Xiong.PlayerIndex index)
 {
     //播放奖励游戏币动画
     //播放奖励游戏币声音
     SoundEffectPlayer.Play("insertcoins.wav");
     //增加奖励的游戏币
     playerRewardCoins[(int)index] += coins;
 }
Пример #13
0
    /// <summary>
    /// スタンプが選択されたところに移動
    /// </summary>
    /// <param name="obj"></param>
    public void SelectFrameMove(GameObject obj)
    {
        var buttonRectTrans = obj.GetComponent <RectTransform>();
        var rectTrans       = Frame.GetComponent <RectTransform>();

        rectTrans.anchoredPosition3D = buttonRectTrans.anchoredPosition3D;

        Player.Play(ChangeSoundResName);
    }
Пример #14
0
    public override void PlayerControllerFixUpdate()
    {
        base.PlayerControllerFixUpdate();
        //需要需要输入控制需要对接机位
        if (IsInputController)
        {
            if (InputDevice.TurnLeft((int)playerIndex))
            {
                playerTurnDirect = PlayerTurnDirect.Turn_Left;
            }
            else if (InputDevice.TurnRight((int)playerIndex))
            {
                playerTurnDirect = PlayerTurnDirect.Turn_Right;
            }
            else
            {
                playerTurnDirect = PlayerTurnDirect.Turn_Mid;
            }
            //playerAccelerateSign = playerAIControler.accelerateMinValue + InputDevice.Accelerate((int)playerIndex);

            //Debug.Log("acc01 == " + InputDevice.Accelerate(0) + ", acc02 == " + InputDevice.Accelerate(1));
            if (InputDevice.Accelerate(0) <= 0.1f && InputDevice.Accelerate(1) <= 0.1f)
            {
                //两个玩家都不踩脚踏板时,使玩家保持在镜头边缘.
                playerAccelerateSign = -0.05f;
            }
            else
            {
                playerAccelerateSign = playerAIControler.mPlayerAccMinRecord + InputDevice.Accelerate((int)playerIndex);
            }

            if (InputDevice.ButtonFireDown((int)playerIndex))
            {
                if (!IsPlayerSystemForceAccelerateSign)
                {
                    StartSupSpeed();

                    Invoke("CloseSupSpeed", m_SupSpeedKeepTime);
                }
            }
        }

        if (myTransform.localPosition.x <= 0f &&
            !((RaceSceneControl)GameRoot.CurrentSceneControl).m_WaitMeUI[(int)playerIndex].activeInHierarchy)
        {
            ((RaceSceneControl)GameRoot.CurrentSceneControl).m_WaitMeUI[(int)playerIndex].SetActive(true);
            //播放"等等我"语言.
            SoundEffectPlayer.Play("WaitMe.wav");
        }

        if (myTransform.localPosition.x > 0f &&
            ((RaceSceneControl)GameRoot.CurrentSceneControl).m_WaitMeUI[(int)playerIndex].activeInHierarchy)
        {
            ((RaceSceneControl)GameRoot.CurrentSceneControl).m_WaitMeUI[(int)playerIndex].SetActive(false);
        }
    }
    public void TouchEvent(GameObject button)
    {
        var clone = (GameObject)Instantiate(EffectPrefab, button.transform.position, Quaternion.identity);

        clone.transform.parent = transform;
        iTween.ScaleTo(clone, Vector3.zero, 0);
        var resName = Random.Range(0, SoundResName.Count);

        Player.Play(SoundResName[resName]);
    }
        private void ClickEscBtEvent(InputKillVirus.ButtonState val)
        {
            if (val == InputKillVirus.ButtonState.DOWN)
            {
                return;
            }

            if (IGamerProfile.Instance != null)
            {
                SoundEffectPlayer.Play("buttonok.wav");
            }
        }
Пример #17
0
    // Update is called once per frame
    void Update()
    {
        if (mover.IsRain)
        {
            if (Player.IsPlaying(RainResName))
            {
                return;
            }

            Player.Play(RainResName);
        }
    }
Пример #18
0
    public void Open()
    {
        if (!ModeManager.IsGameMode)
        {
            return;
        }
        if (State != STATE.Close)
        {
            return;
        }

        State = STATE.Open;
        MoveAnimation.Blend(OpenAnimClip.name, 0.3f);
        SEPlayer.Play(OpenSoundResName);

        if (StampList.activeSelf)
        {
            return;
        }
        StampList.SetActive(true);
    }
Пример #19
0
 private void OnButtonSelectOk(int index)
 {
     SoundEffectPlayer.Play("buttonok.wav");
     if (result == Result.Result_Win)
     {
         UiSceneUICamera.Instance.LoadNextLevel();
     }
     else if (result == Result.Result_Faile)
     {
         //任务失败重新加载当前地图
         UiSceneUICamera.Instance.RestartLoadLevel();
     }
 }
Пример #20
0
        public void Draw(SpriteBatch spriteBatch)
        {
            _drawFrames++;
            _drawStopwatch.Start();

            _soundEffectPlayer.Play(_gameState);
            _renderer.Render(spriteBatch, _gameState);

            _hud.Draw(spriteBatch);

            _drawStopwatch.Stop();
            _gameState.Metrics["GamePlayState.Draw"] = new Metric(_drawStopwatch.Elapsed.TotalMilliseconds, _drawFrames);
        }
Пример #21
0
    public void SE()
    {
        if (UISelectManager.IsResetMode)
        {
            return;
        }
        if (Player.IsPlaying(shareSEResName))
        {
            return;
        }

        Player.Play(shareSEResName);
    }
Пример #22
0
    /// <summary
    /// 開くアニメーションの処理
    /// </summary>
    public void Open()
    {
        if (State == STATE.Open)
        {
            return;
        }
        if (!ModeManager.IsGameMode)
        {
            return;
        }
        if (MoveAnimation.isPlaying)
        {
            return;
        }

        State = STATE.Open;
        MoveAnimation.Blend(OpenAnimClip.name, 0.3f);
        StampList.ChangeClose();
        BGM.Stop();
        SEPlayer.Play(OpenSoundResName);
        UIModeChanger.Enable(false);
    }
Пример #23
0
    protected override void OnTriggerEnter(Collider other)
    {
        BrokenObjectController broken = other.gameObject.GetComponent <BrokenObjectController>();

        if (broken == null)
        {
            return;
        }

        if (broken.IsLocker)
        {
            return;
        }

        broken.IsLocker = true;
        //m_particleList = broken.particleList;
        //if (m_particleList != null && m_particleList.Length != 0)
        //{
        //    PlayParticleList(m_particleList);
        //}
        if (broken.m_PropParticleStruct != null)
        {
            PlayParticleList(broken.m_PropParticleStruct);
        }

        //处理被撞物品
        broken.StartBroken(hControllerScriptCS as IParkourControllerScriptCS);
        if (broken.brokenHandleType == BrokenObjectController.BrokenHandleType.HandleType_Barrier)
        {
            //触发碰撞消息
            playerAIControler.OnEventHitBrokenObject();
            //播放碰撞语言
            SoundEffectPlayer.Play("touchbroken.wav");
            //playerSoundControler.PlayAudioSource(IParkourPlayerSound.PlayerSoundType.Type_Barrier);
        }
        else if (broken.brokenHandleType == BrokenObjectController.BrokenHandleType.HandleType_AddScore)
        {
            ////如果没有开始游戏 则不加分 跳过
            //if (!IsEnterStart)
            //{
            ////播放加分语言
            //playerSoundControler.PlayAudioSource(IParkourPlayerSound.PlayerSoundType.Type_AddScore);
            //return;
            //}
            //给玩家加分
            PlayerAddScore((int)broken.brokenValue);
            //播放加分语言
            SoundEffectPlayer.Play("touchgold.wav");
            //playerSoundControler.PlayAudioSource(IParkourPlayerSound.PlayerSoundType.Type_AddScore);
        }
    }
Пример #24
0
    public override void OnUpdate()
    {
        m_GameOverTime -= Time.deltaTime;
        EnterStart();

        if (!timeLocker.IsLocked)
        {
            SoundEffectPlayer.Play("timeclock.wav");
            timeLocker.IsLocked = true;
        }
        if (m_GameOverTime <= 0)
        {
            EngGame();
            m_GameContinueControl.StopShowGameOver();
        }
    }
    //显示开始游戏
    private void ShowGameStart()
    {
        if (LoadObject != null)
        {
            UnityEngine.GameObject.Destroy(LoadObject);
            LoadObject = null;
        }
        if (SelectMap_Remainder != null)
        {
            UnityEngine.GameObject.Destroy(SelectMap_Remainder.gameObject);
            SelectMap_Remainder = null;
        }
        Prompt_GameStart = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("Prompt_GameStart.prefab", GameRoot.gameResource);
        GuiPlaneAnimationPlayer ani = GameObject.Find("/UICamera(Clone)/Prompt_GameStart(Clone)/text").GetComponent <GuiPlaneAnimationPlayer>();

        ani.DelegateOnPlayEndEvent += PromptGameStartPlayEnd;
        ani.Play();
        SoundEffectPlayer.Play("startgame.wav");
    }
    private void InitUI()
    {
        m_Background  = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("SelectMapBackground.prefab", GameRoot.gameResource);
        LoadObject    = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("SelecetMapLoadgame.prefab", GameRoot.gameResource);
        progressBar   = GameObject.Find("/UICamera(Clone)/SelecetMapLoadgame(Clone)/bar").GetComponent <GuiPlaneAnimationProgressBar>();
        loadAnimation = GameObject.Find("/UICamera(Clone)/SelecetMapLoadgame(Clone)/X_PlayerRun").GetComponent <Animation>();
        leftposition  = GameObject.Find("/UICamera(Clone)/SelecetMapLoadgame(Clone)/leftposition").GetComponent <Transform>();
        rightposition = GameObject.Find("/UICamera(Clone)/SelecetMapLoadgame(Clone)/rightposition").GetComponent <Transform>();
        //设置进度值
        progressBar.SetProgressBar(currentProgressValue);
        //设置动画
        loadAnimation.wrapMode = WrapMode.Loop;
        loadAnimation.CrossFade("X_PlayerRun");

        SelectMap_Remainder  = GameRoot.uiOrthographicCamera.LoadLanguageResource_UIPrefabs("SelectMap_Remainder.prefab", GameRoot.gameResource).GetComponent <GuiPlaneAnimationTextAdvanced>();
        currentRemainderTime = RemainderTime;
        UpdateTime();
        SoundEffectPlayer.Play("loadgame.wav");
    }
Пример #27
0
    private void OnDialogReback(int dialogid, GuiExtendDialog.DialogFlag ret)
    {
        switch (ret)
        {
            case GuiExtendDialog.DialogFlag.Flag_Cancel:
                {
                    SoundEffectPlayer.Play("buttonok.wav");
                    UnityEngine.Object.DestroyObject(this.gameObject);
                }
                break;
            case GuiExtendDialog.DialogFlag.Flag_Ok:
                {
                    SoundEffectPlayer.Play("buttonok.wav");
                    UiSceneUICamera.Instance.LoadUILevel(UiSceneGameLoading.LoadingType.Type_LoadingUIMap);
                }
                break;
        }

    }
Пример #28
0
    // Update is called once per frame
    void Update()
    {
        if (!ModeManager.IsGameMode)
        {
            return;
        }
        if (!StampList.IsCreate)
        {
            return;
        }

        ChangeTreeBranch();

        if (TouchManager.IsTouching(TreeBranch) || TouchManager.IsMouseButton(TreeBranch))
        {
            CreatePrefab();
            SEPlayer.Play(CreateSoundResName);
        }
    }
 //需要重载Input刷新函数
 //如果返回true,表示可以继续刷新后面的对象,否则刷新处理会被截断
 public override bool OnInputUpdate()
 {
     if (InputDevice.ButtonBack)
     {
         SoundEffectPlayer.Play("buttonok.wav");
         //让本身停止工作
         IsStartWork = false;
         LoadResource_UIPrefabs("gameback.prefab");
     }
     else if (GameCenterEviroment.platformChargeIntensity >= GameCenterEviroment.PlatformChargeIntensity.Intensity_VeryVeryHigh &&
              (InputDevice.ButtonPressOk ||
               InputDevice.ButtonPressLeft ||
               InputDevice.ButtonPressRight ||
               InputDevice.ButtonPressUp ||
               InputDevice.ButtonPressDown) &&
              IsStartWork &&
              currentSkillprompt != null &&
              currentSkillpromptmove == null)
     {
         //停止工作
         IsStartWork = false;
         FireSkill();
         return(false);
     }
     else if (InputDevice.ButtonOk && IsStartWork && currentSkillprompt != null && currentSkillpromptmove == null)
     {
         //停止工作
         IsStartWork = false;
         FireSkill();
         return(false);
     }
     //测试
     else if (Input.GetKeyDown(KeyCode.F1))
     {
         LevelComplete(true);
     }
     else if (Input.GetKeyDown(KeyCode.F2))
     {
         LevelComplete(false);
     }
     return(true);
 }
    private void OnShowAwardFace()
    {
        SoundEffectPlayer.Play("buttonok.wav");
        //显示关卡完成字样
        GuiPlaneAnimationPlayer gameoverprompt = null;

        if (result == UiSceneGameOver.Result.Result_Win)
        {
            gameoverprompt = LoadResource_UIPrefabs("gamewinprompt.prefab").GetComponent <GuiPlaneAnimationPlayer>();
        }
        else
        {
            gameoverprompt = LoadResource_UIPrefabs("gamefaileprompt.prefab").GetComponent <GuiPlaneAnimationPlayer>();
        }
        gameoverprompt.Stop();
        gameoverprompt.Play();
        gameoverprompt.DelegateOnPlayEndEvent += GameOverPromptPlayEnd;
        //完成关卡后显示奖励获取界面
        //LoadResource_UIPrefabs("gameaward.prefab");
    }