예제 #1
0
    void Start()
    {
        lives      = 3;
        rewarded   = false;
        firstSpawn = true;

        /*----------------------------------------------------------
         * if ship doesnt have a Rigidbody
         * then it will be added and added to the rb
         * var and if it have one then just add it to the
         * rb var
         *--------------------------------------------------------*/
        if (_shipEty.GetComponent <Rigidbody2D>() == null)
        {
            gameObject.AddComponent <Rigidbody2D>();
            rb = _shipEty.GetComponent <Rigidbody2D>();
        }
        else
        {
            rb = _shipEty.GetComponent <Rigidbody2D>();
        }

        if (gu == null)
        {
            gu = _manager.GetComponent <ghsUtility>();
        }

        if (bc2D == null)
        {
            bc2D = _shipEty.GetComponent <BoxCollider2D>();
        }

        rb.gravityScale = 0.0f;
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     shipNum = 0;
     shipsList();
     displayShip(0);
     gu = GetComponent <ghsUtility>();
 }
예제 #3
0
    void Start()
    {
        PlayGamesPlatform.Activate();
        site = "https://ghostszmusic.com/api/ghs_api/v1/";

                #if UNITY_EDITOR
        site = "http://localhost:3000/api/ghs_api/v1/";
                #endif

        ghs       = getData();
        dataPath  = Application.persistentDataPath + "/WorldDefer/saves/save.sav";
        Instance  = this;
        scene     = SceneManager.GetActiveScene();
        sceneName = scene.name;

        if (sceneName == "Settings")
        {
            settings = GetComponent <settingsScr>();
        }
    }
예제 #4
0
    // Use this for initialization
    void Start()
    {
        if (_manager == null)
        {
            _manager = GameObject.FindGameObjectWithTag("manager");
        }

        if (sm == null)
        {
            sm = _manager.GetComponent <scoreManager>();
        }

        if (con == null)
        {
            con = GameObject.FindGameObjectWithTag("Player").GetComponent <controller>();
        }

        gu           = this.gameObject.transform.parent.gameObject.GetComponent <ghsUtility>();
        ghs          = gu.getData();
        preHS.text   = sm.scoreTXT.text;
        preGOHS.text = sm.scoreTXT.text;

        if (ghs.user_icon != null)
        {
            getUserIcon(ghs.useBlob, ghs.user_icon, userIconPS);
            getUserIcon(ghs.useBlob, ghs.user_icon, userIconGOS);
        }

        if (ghs.name != null)
        {
            userNamePS.text  = ghs.name;
            userNameGOS.text = ghs.name;
        }
        else
        {
            userNamePS.text  = "username";
            userNameGOS.text = "username";
        }

        rewardBtn.enabled = !con.rewarded;
    }