コード例 #1
0
    //public GameObject TransitionCam;

    void Start()
    {
        HUDcharacter = characterImage.GetComponent <Animator>();



        if (!isInitialized)
        {
            GameObject gameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

            if (gameInstancer != null)
            {
                instance = gameInstancer.GetComponent <scr_GameInstance> ();
            }

            instance.LoadUserProfile();
            GetComponent <scr_PowerUpMethods>().FindMethod(ref powerupAction, instance.UserProfile.playerEngine.CodeName, ref HUDcharacter);
            HUDcharacter.Play("idle");

            GameObject user = Instantiate(instance.ShipObjects.Find(obj => obj.name == instance.UserProfile.playerShip.ShipName), spawnPoint);
            Debug.Log("Thiis guy is" + user.tag);
            player = user.GetComponent <scr_playerBehaviour> ();
            ChangeStats();
            player.stats.difficulty = player.stats.Difficulty();
            powerupAction("Start", player);
            leaveSpeed = player.stats.speed / 2;

            Initialize();
            isInitialized = true;
        }
        enabled = false;
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        btnGoBack.onClick.AddListener(GoBack);
        HideAllScores();
        GameObject gameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

        if (gameInstancer != null)
        {
            instance = gameInstancer.GetComponent <scr_GameInstance> ();
        }
        instance.LoadHighscores();

        SlotsAmount = txsNames.Length;

        for (int i = 0; i < SlotsAmount; i++)
        {
            if (instance.Highscores.highscores[i] != null & i < SlotsAmount)
            {
                txsNames [i].SetActive(true);
                txsNames [i].GetComponentInChildren <Text> ().text = instance.Highscores.highscores[i].User;

                txsLevels [i].SetActive(true);
                txsLevels [i].GetComponentInChildren <Text> ().text = instance.Highscores.highscores[i].levelName;

                txsScores [i].SetActive(true);
                txsScores [i].GetComponentInChildren <Text> ().text = instance.Highscores.highscores[i].score.ToString();
            }
        }
    }
コード例 #3
0
    void Start()
    {
        GameObject gameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

        if (gameInstancer != null)
        {
            instance = gameInstancer.GetComponent <scr_GameInstance> ();

            ships = new LinkedList <Ship> ();

            foreach (Ship s in instance.shipList.ships)
            {
                if (s.isUnlocked)
                {
                    ships.AddLast(s);
                    Debug.Log("ADDING THIS ONE");
                }
            }
            ship = ships.First;

            Instantiate(ShipObjs.Find(s => s.name == "menu_" + ship.Value.ShipName).gameObject, ShipSpawnPoint.transform);
            UpdateStats();

            btnGoBack.onClick.AddListener(GoBack);
        }
        else
        {
            Debug.Log("Game Instancer has not been added to the Scene! Fix that first!");
        }

        btnNext.onClick.AddListener(CreateProfile);
        btnGoBack.onClick.AddListener(GoBack);
    }
コード例 #4
0
    void Start()
    {
        GameObject GameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

        if (GameInstancer != null)
        {
            instance = GameInstancer.GetComponent <scr_GameInstance> ();
            if (instance.DoesProfileExist())
            {
                if (instance.UserProfile != null)
                {
                    ProfileFoundLayout();
                    instance.ReloadShips();
                    instance.ReloadEngines();
                    txtCurrentUser.text = string.Format("Hello {0}, What would you like to do?", instance.UserProfile.ProfileName);
                }
            }
            else
            {
                NoProfileLayout();
                txtCurrentUser.text = string.Format("No Profile Found. Create New Profile Above.");
            }
        }

        btnStartGame.onClick.AddListener(StartGame);
        btnCheckProfile.onClick.AddListener(CheckProfile);
        btnEraseProfile.onClick.AddListener(DeleteProfileAndRestart);

        btnLottery.onClick.AddListener(Lottery);
        btnLeaderboards.onClick.AddListener(Leaderboards);
        btnSettings.onClick.AddListener(Settings);

        btnCreateProfile.onClick.AddListener(CreateProfile);
        btnQuitGame.onClick.AddListener(QuitGame);
    }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        GameObject gameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

        Engines = new EngineList();


        hideAllEffects();
        if (gameInstancer != null)
        {
            instance = gameInstancer.GetComponent <scr_GameInstance> ();
            Engines  = gameInstancer.GetComponent <scr_GameInstance> ().engineList;
        }
        else
        {
            Debug.Log("Game Instancer has not been added to the Scene! Fix that first!");
        }


        foreach (var e in Engines.engines)
        {
            if (e.CodeName == "GC")
            {
                btnGC.interactable = e.isUnlocked;
                btnGC.onClick.AddListener(GannonCannon);
            }
            else if (e.CodeName == "DDD")
            {
                btnDDD.interactable = e.isUnlocked;
                btnDDD.onClick.AddListener(DArcyDefenseDemolisher);
            }
            else if (e.CodeName == "KCDC")
            {
                btnKCDC.interactable = e.isUnlocked;
                btnKCDC.onClick.AddListener(KonradCheatDeathContraption);
            }
            else if (e.CodeName == "MMC")
            {
                btnMMC.interactable = e.isUnlocked;
                btnMMC.onClick.AddListener(MahadyMatterConverter);
            }
            else if (e.CodeName == "SS")
            {
                btnSS.interactable = e.isUnlocked;
                btnSS.onClick.AddListener(SzczodrowskiStrike);
            }
        }

        btnRedPowerup.onClick.AddListener(RedPowerupSelected);
        btnBluePowerup.onClick.AddListener(BluePowerupSelected);
        btnGreenPowerup.onClick.AddListener(GreenPowerupSelected);

        btnGoBack.onClick.AddListener(GoBack);
        btnStartGame.onClick.AddListener(StartGame);

        txEngineSelected.text  = "";
        txPowerupSelected.text = "";
        txSpecialAbility.text  = "";
    }
コード例 #6
0
    // Use this for initialization
    void Start()
    {
        GameObject GameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

        if (GameInstancer != null)
        {
            instance = GameInstancer.GetComponent <scr_GameInstance> ();
        }

        MainMenu.SetActive(true);
    }
コード例 #7
0
    // Use this for initialization
    void Start()
    {
        GameObject GameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

        if (GameInstancer != null)
        {
            instance = GameInstancer.GetComponent <scr_GameInstance> ();
        }

        inputUserName.onValueChanged.AddListener(ValidateTextBox);
        inputUserName.onEndEdit.AddListener(OnUsernameEntered);
        btnCreate.onClick.AddListener(CreateProfile);
        btnBack.onClick.AddListener(GoBack);
    }
コード例 #8
0
    void Start()
    {
        r = new Random();
        foreach (GachaDropPool g in dropPools)
        {
            range += g.Chance;
        }

        GameObject GameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

        if (GameInstancer != null)
        {
            instance = GameInstancer.GetComponent <scr_GameInstance> ();
            eList    = instance.engineList;
            sList    = instance.shipList;
        }
    }
コード例 #9
0
    // Use this for initialization
    void Start()
    {
        GameObject GameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

        gacha = GetComponent <Gacha>();

        if (GameInstancer != null)
        {
            instance = GameInstancer.GetComponent <scr_GameInstance> ();
        }
        Timer             = -999f;
        CrystalSpawnStart = CrystalSpawn.transform;
        CrystalSpawn.SetActive(false);
        btnGoBack.onClick.AddListener(GoBack);
        btnNext.onClick.AddListener(Next);
        btnSinglePull.onClick.AddListener(SingleRoll);
        btnTriplePull.onClick.AddListener(TripleRoll);
        btnAddCrystals.onClick.AddListener(AddCrystalsDebug);
    }
コード例 #10
0
    // Use this for initialization
    void Start()
    {
        GameObject gameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

        if (gameInstancer != null)
        {
            instance = gameInstancer.GetComponent <scr_GameInstance> ();
        }
        DefaultProfileView();

        PlayerNameInput.onValueChanged.AddListener(ValidateTextBox);
        PlayerNameInput.onEndEdit.AddListener(OnUsernameEntered);

        btnGoBack.onClick.AddListener(GoBack);
        btnEditProfileName.onClick.AddListener(EditProfileName);
        btnInventory.onClick.AddListener(Inventory);
        btnConfirmEdit.onClick.AddListener(ConfirmEdit);

        LoadValues();
    }
コード例 #11
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("Waaait a second..");
        GameObject gameInstancer = GameObject.FindGameObjectWithTag("GameInstancer");

        if (gameInstancer != null)
        {
            instance = gameInstancer.GetComponent <scr_GameInstance> ();

            ships = new LinkedList <Ship> ();
            lores = new List <Lore> ();
            foreach (Ship s in instance.shipList.ships)
            {
                ships.AddLast(s);
            }

            foreach (Lore l in instance.loreList.Lores)
            {
                lores.Add(l);
            }
        }


        btnEnlargeShip.onClick.AddListener(EnlargeShip);
        btnGoBack.onClick.AddListener(GoBack);

        btnAnaconda.onClick.AddListener(AnacondaSelected);
        btnScarab.onClick.AddListener(ScarabSelected);
        btnCebula.onClick.AddListener(CebulaSelected);

        txShipLore.text          = "Select a ship first!";
        NoFactionSelectedTx.text = "Select a faction below!";

        btnGoBackToInv.onClick.AddListener(GoBackToInventory);

        cvInventory.SetActive(true);
        cvPreview.SetActive(false);
        ship = new LinkedListNode <Ship>(new Ship());
    }
コード例 #12
0
 void Awake()
 {
     control = this;
     DontDestroyOnLoad(transform.gameObject);
 }