コード例 #1
0
    public void MenuDisplay()
    {
        SceneName = SceneManager.GetActiveScene().name;
        int ret = Array.IndexOf(UnDisplaySceneName, SceneName);     //現在のシーンと表示したくないシーンがあったら

        if (ret < 0)
        {
            Menu_Display = !menu_toggle.isOn;
            if (!Menu_Display)
            {
                //player_move_controller.enabled = true;

                player_move_controller.GetComponent <Rigidbody2D>().bodyType = RigidbodyType2D.Dynamic;
            }
            else if (Menu_Display)
            {
                player_move_controller.GetComponent <Rigidbody2D>().bodyType = RigidbodyType2D.Static;
            }
            if (!ItemMenuDisplay)
            {
                menu_toggle.isOn = Menu_Display;
            }
            Menu.GetComponent <Animator>().SetBool("display", Menu_Display);
            player_move_controller.GetComponent <Animator>().enabled = !Menu_Display;
            player_move_controller.moveMode = !Menu_Display;
            if (Menu_Display)
            {
                GameObject g = Menu.transform.GetChild(0).gameObject;
                game_manager_script.BasicSelectObject(g);
            }
        }
    }
コード例 #2
0
    void Awake()
    {
        //if (Application.isEditor) {
        //	active = false;
        //}
        if (active)
        {
            analyticsman = GameObject.Find("AnalyticsManager").GetComponent <AnalyticsManager>();
            if (analyticsman.experimentmode)
            {
                dataload = analyticsman.dataload.ExperimentVariables();

                if (dataload.ContainsKey("PlayerGravity"))
                {
                    player.GetComponent <Rigidbody2D>().gravityScale = float.Parse(dataload["PlayerGravity"]);
                }
                if (dataload.ContainsKey("CannonRotateSpeed"))
                {
                    launcher.rotateSpeed = float.Parse(dataload["CannonRotateSpeed"]);
                }
                if (dataload.ContainsKey("CannonMaxAngle"))
                {
                    launcher.angleMax = float.Parse(dataload["CannonMaxAngle"]);
                }
                if (dataload.ContainsKey("CannonMinAngle"))
                {
                    launcher.angleMin = float.Parse(dataload["CannonMinAngle"]);
                }
                if (dataload.ContainsKey("InitialLaunchVelocity"))
                {
                    ingameman.initialstartforcemagnitude = float.Parse(dataload["InitialLaunchVelocity"]);
                }
                if (dataload.ContainsKey("ThrusterDuration"))
                {
                    player.bouncedownDuration = float.Parse(dataload["ThrusterDuration"]);
                }
                if (dataload.ContainsKey("ThrusterCooldownTime"))
                {
                    player.bounceRecoverTime = float.Parse(dataload["ThrusterCooldownTime"]);
                }
                if (dataload.ContainsKey("ThrusterForce_X"))
                {
                    player.bouncedownEffect.x = float.Parse(dataload["ThrusterForce_X"]);
                }
                if (dataload.ContainsKey("ThrusterForce_Y"))
                {
                    player.bouncedownEffect.y = float.Parse(dataload["ThrusterForce_Y"]);
                }
                if (dataload.ContainsKey("GroundSpeedReduction"))
                {
                    player.groundhitDecayAmt = float.Parse(dataload["GroundSpeedReduction"]);
                }
                if (dataload.ContainsKey("BouncerSpeedReduction"))
                {
                    player.bouncerhitDecayAmy = float.Parse(dataload["BouncerSpeedReduction"]);
                }
                if (dataload.ContainsKey("BouncerForce_X"))
                {
                    player.bouncerupEffect.x = float.Parse(dataload["BouncerForce_X"]);
                }
                if (dataload.ContainsKey("BouncerForce_Y"))
                {
                    player.bouncerupEffect.y = float.Parse(dataload["BouncerForce_Y"]);
                }
                if (dataload.ContainsKey("BouncersBaseFrequency"))
                {
                    bouncers.baseBouncerChance = float.Parse(dataload["BouncersBaseFrequency"]);
                }
                if (dataload.ContainsKey("BouncersChanceDecreasePerHundredFt"))
                {
                    bouncers.chanceDecreasePerHundredFeet = float.Parse(dataload["BouncersChanceDecreasePerHundredFt"]);
                }
                if (dataload.ContainsKey("DistanceToEarnOneCurrency"))
                {
                    shop.disttogetcurrency = int.Parse(dataload["DistanceToEarnOneCurrency"]);
                }
                if (dataload.ContainsKey("SpeedBoostInitialCost"))
                {
                    shop.speedboost_initialcost = int.Parse(dataload["SpeedBoostInitialCost"]);
                }
                if (dataload.ContainsKey("SpeedBoostCostIncreaseExponent"))
                {
                    shop.speedboost_exponentincrease = float.Parse(dataload["SpeedBoostCostIncreaseExponent"]);
                }
                if (dataload.ContainsKey("ThrustersInitialCost"))
                {
                    shop.thruster_initialcost = int.Parse(dataload["ThrustersInitialCost"]);
                }

                if (dataload.ContainsKey("ThrustersCostIncreaseExponent"))
                {
                    shop.thruster_exponentincrease = float.Parse(dataload["ThrustersCostIncreaseExponent"]);
                }
            }
        }
    }