Esempio n. 1
0
    void  SplitforceInitialised(bool isFailed, Hashtable additionalData)
    {
        var _didInit = !isFailed;

        // You can check if everything is correct
        if (isFailed)
        {
            Debug.Log("SPLITFORCE: Init FAILED" + additionalData.ToString(), gameObject);
        }
        else
        {
            Debug.Log("SPLITFORCE: Init SUCCESS", gameObject);
        }


        // Experiment GamePhysics
        UnitySplitForce.SFVariation v = UnitySplitForce.SFManager.Instance.initExperiment("GamePhysics");

        if (v != null)
        {
            this.birdColor = v.VariationData("color").DataToColor32();
            this.gravity   = v.VariationData("gravity").DataToFloat(gravity);
            this.jump      = v.VariationData("jump").DataToFloat(jump);
            this.gapPipe   = v.VariationData("gap pipe").DataToFloat(gapPipe);
            Debug.Log("Setting SF stuff (color: " + this.birdColor + ")");
        }


        GenerateWorld world = camera.GetComponent <GenerateWorld> ();

        world.gapPipe = this.gapPipe;

        world.maintenance(this.transform.position.x);
        this.renderer.material.color = this.birdColor;


        // Experiment #2
        string buttonText = "Default Text";

        UnitySplitForce.SFVariation b = UnitySplitForce.SFManager.Instance.initExperiment("Experiment #2");

        if (b != null)
        {
            this.buttonText = b.VariationData("Button Text").DataToString();
        }
    }
Esempio n. 2
0
    void OnTriggerEnter(Collider other)
    {
        isDead = true;
        UnitySplitForce.SFVariation v = UnitySplitForce.SFManager.Instance.getExperiment("GamePhysics");
        Debug.Log("Dead :(");

        if (v != null)
        {
            Debug.Log("Sending Goals");

            v.trackGoal("Ping");
            v.trackTime("Average Session");

            v.trackQuantifiedGoal("Average Score", int.Parse(scoreLabel.text));
            v.endVariation();
        }
    }