// Use this for initialization
    void Start()
    {
        controlObj = Control_Script.controlObj;
        cScript    = controlObj.GetComponent <Control_Script>();
        switch (myWindowType)
        {
        case windowType.CHARACTER:
            cScript.characterWindow = this.gameObject;
            break;

        case windowType.MENU:
            cScript.menuWindow = this.gameObject;
            break;

        case windowType.WEAPONS:
            cScript.weaponsWindow = this.gameObject;
            break;

        case windowType.ARMOUR:
            cScript.armourWindow = this.gameObject;
            break;

        case windowType.FEEDBACK:
            cScript.feedbackWindow = this.gameObject;
            break;

        case windowType.MICROTRANSACTIONS:
            cScript.mtWindow = this.gameObject;
            break;
        }
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        ps       = GetComponent <ParticleSystem> ();
        c        = Control_Script.controlObj.GetComponent <Control_Script> ();
        rb       = GetComponent <Rigidbody> ();
        startPos = transform.position;
        float colR = Random.Range(0.0f, 3.0f);

        switch ((int)colR)
        {
        case 0:
            myColor = "Y";
            GetComponent <MeshRenderer> ().material.color = new Color(1.0f, 0.5f, 1.0f);
            break;

        case 1:
            myColor = "G";
            GetComponent <MeshRenderer> ().material.color = Color.green;
            break;

        case 2:
            myColor = "B";
            GetComponent <MeshRenderer> ().material.color = Color.blue;
            break;
        }

        gravForce = initGravForce;
        SetGrav();
    }
 // Use this for initialization
 void Start()
 {
     myMaterial    = GetComponent <MeshRenderer>().material;
     startingColor = myMaterial.color;
     controlObj    = Control_Script.controlObj;
     c             = controlObj.GetComponent <Control_Script> ();
 }
Exemple #4
0
    public void LevelUp()
    {
        level++;
        currentExp -= maxExp;
        expAdd      = Mathf.RoundToInt(expAdd * 1.15f);
        maxExp      = Mathf.RoundToInt(maxExp * 1.5f);

        if (level == 5)
        {
            if (cScript != null)
            {
                cScript.SetQuestActive("QU01");
            }
            else
            {
                print("Control Script not properly accessed");

                cScript = Control_Script.controlObj.GetComponent <Control_Script> ();
                if (cScript != null)
                {
                    cScript.SetQuestActive("QU01");
                }
                else
                {
                    print("Control Script not able to be accessed");
                }
            }
        }
    }
Exemple #5
0
 void Start()
 {
     myText   = transform.GetChild(0).gameObject.GetComponent <Text> ();
     myButton = GetComponent <Button> ();
     GetCostGold();
     GetResultGold();
     myText.text = resultText;
     c           = Control_Script.controlObj.GetComponent <Control_Script> ();
     StartCoroutine("CheckGems");
 }
Exemple #6
0
    // Use this for initialization
    void Start()
    {
        cScript = Control_Script.controlObj.GetComponent <Control_Script>();

        workButton.onClick.AddListener(() => DoWorkAction());
        trainButton.onClick.AddListener(() => DoTrainAction());
        exploreButton.onClick.AddListener(() => DoExploreAction());
        toMainButton.onClick.AddListener(() => GoToMain());

        gameObject.SetActive(false);
    }
Exemple #7
0
    // Use this for initialization
    void Start()
    {
        myStartingColor = new Color[myMats.Length];
        for (int i = 0; i < myMats.Length; i++)
        {
            myStartingColor[i] = myMats[i].color;
        }

        controlObj = Control_Script.controlObj;
        c          = controlObj.GetComponent <Control_Script> ();
    }
 // Use this for initialization
 void Start()
 {
     myMaterials   = GetComponent <MeshRenderer>().materials;
     startingColor = new Color[myMaterials.Length];
     foreach (Color c in startingColor)
     {
         startingColor[System.Array.IndexOf(startingColor, c)] = myMaterials [System.Array.IndexOf(startingColor, c)].color;
     }
     controlObj = Control_Script.controlObj;
     cScript    = controlObj.GetComponent <Control_Script> ();
 }
Exemple #9
0
 // Use this for initialization
 void Start()
 {
     cScript = Control_Script.controlObj.GetComponent <Control_Script>();
     quitButton.onClick.AddListener(() => cScript.QuitGame());
     mainMenuButton.onClick.AddListener(() => cScript.ReturnToMainMenu());
     newGameButton.onClick.AddListener(() => ActivateConfirmationWindow());
     confirmButton.onClick.AddListener(() => NewGame());
     noButton.onClick.AddListener(() => GoToMain());
     mtButtonMenu.onClick.AddListener(() => cScript.MTBUTTON());
     toMainButton.onClick.AddListener(() => GoToMain());
     gameObject.SetActive(false);
 }
    // Use this for initialization
    void Start()
    {
        controlObj = Control_Script.controlObj;
        cScript    = controlObj.GetComponent <Control_Script>();

        cScript.bottomMenu = this.gameObject.GetComponent <Bottom_Menu_Script>();
        characterButton.onClick.AddListener(() => cScript.SetActiveWindow(Control_Script.windows.CHARACTER));
        menuButton.onClick.AddListener(() => cScript.SetActiveWindow(Control_Script.windows.MENU));

        tutButton1.onClick.AddListener(() => TutButtonOne());
        tutButton2.onClick.AddListener(() => TutButtonTwo());
        tutButton3.onClick.AddListener(() => TutButtonThree());

        cScript.adPanel = advertisementPanel;
    }
    // Use this for initialization
    void Start()
    {
        controlObj = Control_Script.controlObj;
        c          = controlObj.GetComponent <Control_Script>();

        c.tOneAB   = tOneA;
        c.tTwoAB   = tTwoA;
        c.tThreeAB = tThreeA;

        tOneA.onClick.AddListener(() => c.TOneAButton());
        tTwoA.onClick.AddListener(() => c.TTwoAButton());
        tThreeA.onClick.AddListener(() => c.TThreeAButton());
        mtButton.onClick.AddListener(() => c.MTBUTTON());
        toMainButton.onClick.AddListener(() => c.SetActiveWindow(Control_Script.windows.NONE));

        gameObject.SetActive(false);
    }
    // Use this for initialization
    void Start()
    {
        c = Control_Script.controlObj.GetComponent <Control_Script> ();
        toMainButton.onClick.AddListener(() => GoToMain());

        gOne.onClick.AddListener(() => c.BuyGold(1));
        gTwo.onClick.AddListener(() => c.BuyGold(2));
        gThree.onClick.AddListener(() => c.BuyGold(3));
        gFour.onClick.AddListener(() => c.BuyGold(4));

        gemOne.onClick.AddListener(() => c.BuyGems(1));
        gemTwo.onClick.AddListener(() => c.BuyGems(2));
        gemThree.onClick.AddListener(() => c.BuyGems(3));
        gemFour.onClick.AddListener(() => c.BuyGems(4));

        gameObject.SetActive(false);
    }
    // Use this for initialization
    void Start()
    {
        GameObject     controlObj = Control_Script.controlObj;
        Control_Script c          = controlObj.GetComponent <Control_Script>();

        c.sabButton  = sabButton;
        c.twoHButton = twoHButton;
        c.dwButton   = dwButton;

        sabButton.onClick.AddListener(() => c.SabButton());
        twoHButton.onClick.AddListener(() => c.TwoHButton());
        dwButton.onClick.AddListener(() => c.DWButton());

        mtButton.onClick.AddListener(() => c.MTBUTTON());

        toMainButton.onClick.AddListener(() => c.SetActiveWindow(Control_Script.windows.NONE));

        gameObject.SetActive(false);
    }
    void Start()
    {
        controlObj = Control_Script.controlObj;
        cScript    = controlObj.GetComponent <Control_Script>();

        cScript.goldAddText       = goldText;
        cScript.expAddText        = expText;
        cScript.levelCurrentText  = levelText;
        cScript.expCurrentText    = expCurrentText;
        cScript.feedbackTitleText = titleText;

        cScript.adButton = adButton;

        toMainButton.onClick.AddListener(() => cScript.SetActiveWindow(Control_Script.windows.NONE));

        adButton.onClick.AddListener(() => cScript.StartAdvertisement());
        adButton.gameObject.SetActive(false);
        gameObject.SetActive(false);
    }
 // Use this for initialization
 void Start()
 {
     c = Control_Script.controlObj.GetComponent <Control_Script> ();
     c.blacksmithWindow = this.gameObject;
     gameObject.SetActive(false);
 }
 // Use this for initialization
 void Start()
 {
     controlObj = Control_Script.controlObj;
     c          = controlObj.GetComponent <Control_Script> ();
 }