Example #1
0
    public void BackClick()
    {
        force f = new force();

        f.saveData();
        SceneManager.LoadScene(sceneName: "StartScene");
    }
Example #2
0
    public void EasyBackClick()
    {
        force f = new force();

        f.saveData();
        SceneManager.LoadScene(sceneName: "LevelScene");
    }
Example #3
0
 /* Constructor */
 public PlayerData(force forceObject)
 {
     level      = force.level;
     health     = force.health;
     best       = force.previousBestLevel;
     easybest   = force.previousEasyBestLevel;
     mediumbest = force.previousMediumBestLevel;
     hardbest   = force.previousHardBestLevel;
 }
Example #4
0
    public void ClosePanel()
    {
        if (Panel != null)
        {
            f = GameObject.FindGameObjectWithTag("Letter1").GetComponent <force>();

            f.setPaused(false);
            Panel.SetActive(false);
        }
    }
Example #5
0
    public static void SaveForce(force forceObject)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/player1.data";

        FileStream stream = new FileStream(path, FileMode.Create);

        PlayerData data = new PlayerData(forceObject);

        formatter.Serialize(stream, data);
        stream.Close();
    }
Example #6
0
    public void EasyClick()
    {
        force f = new force();

        f.loadData();

        // if (force.previousEasyBestLevel>=1  && force.previousEasyBestLevel <= 5)
        //{
        temp_level = force.previousEasyBestLevel;
        //}
        //else {
        //    temp_level = 1; //1 indicates easy
        //}
        SceneManager.LoadScene(sceneName: "BubbleScene");
    }
Example #7
0
    // Use this for initialization
    public void Start()
    {
        Debug.Log("Start!");
        FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
        Firebase.Analytics.FirebaseAnalytics.LogEvent(
            Firebase.Analytics.FirebaseAnalytics.EventLogin,
            new Firebase.Analytics.Parameter[] {
            new Firebase.Analytics.Parameter(
                Firebase.Analytics.FirebaseAnalytics.ParameterMethod, SystemInfo.deviceUniqueIdentifier),
        }
            );
        hp = GameObject.FindGameObjectWithTag("hint_button").GetComponent <hints_panel>();

        /* for button */
        //Button btn = yourButton.GetComponent<Button>();
        //Button btn = Instantiate(UnityEngine.Object)yourButton).GetComponent<Button>();
        //btn.onClick.AddListener(TaskOnClick);
        //set to false on start, may not be necessary, I just can't remember if C# will return 1 or 0 for undefined booleans
        buttonisclicked = false;
        forceFile       = new force();

        dots     = new List <Vector2> ();
        dotsPool = new List <GameObject> ();

        var i          = 0;
        var alpha      = 1.0f / maxDots;
        var startAlpha = 1.0f;

        while (i < maxDots)
        {
            var dot = Instantiate(dotPrefab) as GameObject;
            var sp  = dot.GetComponent <SpriteRenderer> ();
            var c   = sp.color;

            c.a         = startAlpha - alpha;
            startAlpha -= alpha;
            sp.color    = c;

            dot.SetActive(false);
            dotsPool.Add(dot);
            i++;
        }

        //select initial type
        SetNextType();
        //wordCreated = GameObject.FindGameObjectWithTag("wordCreated").GetComponent<Text>();
    }
Example #8
0
    public void OpenPanelInit(String hint1)
    {
        if (Panel != null)
        {
            f = GameObject.FindGameObjectWithTag("Letter1").GetComponent <force>();

            f.setPaused(true);

            Panel.SetActive(true);
            txt = GameObject.FindWithTag("Hint_Text").GetComponent <Text>() as Text;
            //txt1 = GameObject.FindWithTag("Category_Text").GetComponent<Text>() as Text;
            //txt = gameObject.GetComponent<Text>();
            if (f != null && txt != null)
            {
                // Debug.Log(f.getHint());
                txt.text = hint1;
                //txt1.text = f.getCat().ToUpper();
            }
        }
    }
Example #9
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape)) /* checks if back button is pressed */
        {
            sceneName = SceneManager.GetActiveScene().name;
            Debug.Log("scene name = " + sceneName);
            if (sceneName == "BubbleScene")
            {
                force f = new force();

                Debug.Log("Should enter StartScene");
                f.saveData();
                SceneManager.LoadScene(sceneName: "StartScene");
            }
            else if (sceneName == "StartScene")
            {
                force f = new force();
                f.saveData();
                Debug.Log("Should kill the app");
                Application.Quit();
            }
        }
    }
Example #10
0
    public void HardClick()
    {
        force f = new force();

        f.loadData();
        if (force.previousBestLevel > 12)
        {
            // if (force.previousBestLevel >= 13 && force.previousBestLevel <= 21)
            //{
            temp_level = force.previousHardBestLevel;
            //}
            //else
            //{
            //   temp_level = 13; //13 onwards indicates Hard
            //}
            SceneManager.LoadScene(sceneName: "BubbleScene");
        }
        else
        {
            SceneManager.LoadScene(sceneName: "LockedLevelScene");
            //Display canvas saying complete Easy and Medium Levels first
        }
    }
Example #11
0
    public void MediumClick()
    {
        force f = new force();

        f.loadData();

        if (force.previousBestLevel > 5)
        {
            //        if (force.previousBestLevel >= 6 && force.previousBestLevel <= 12)
            //      {
            temp_level = force.previousMediumBestLevel;
            //     }
            //   else
            //   {
            //      temp_level = 6; //6 onwards indicates medium
            // }
            SceneManager.LoadScene(sceneName: "BubbleScene");
        }
        else
        {
            SceneManager.LoadScene(sceneName: "LockedLevelScene");
            //Display canvas saying complete Easy Level First
        }
    }
Example #12
0
 protected override DHJassValue Run()
 {
     force f = new force();
     return new DHJassHandle(null, f.handle);
 }