示例#1
0
    public void UpdateStatus(string statusMsg)
    {
        StatusText.GetComponent <Text>().text = statusMsg;
        Debug.Log(statusMsg);
        if (PeerType == 1)
        {
            CardListPanel.SetActive(true);
            PeerListPanel.SetActive(false);
            //      SendProfileBtn.SetActive(true);

            foreach (string card in cardList)
            {
                Debug.Log("card : " + card);
                GameObject button = (GameObject)Instantiate(CardPrefab);
                button.transform.SetParent(cardParent.transform);
                Debug.Log("Button Created");
                button.GetComponent <RawImage>().texture = imageTextures[cardList.IndexOf(card)];

                button.GetComponent <Button>().onClick.AddListener(() => CardClick(card));
            }
        }
        else
        {
            Image.SetActive(false);
            ConnectedImage.SetActive(true);
        }
        Debug.Log(statusMsg);
    }
示例#2
0
    // Use this for initialization
    void Awake()
    {
        score = 0;

        //配列の初期化
        for (int i = 0; i < board.GetLength(0); i++)
        {
            for (int j = 0; j < board.GetLength(1); j++)
            {
                board[i, j]     = -1;
                board_num[i, j] = -1;
            }
        }

        //初期用配列設定
        board[0, 0]     = maxDiceId;
        board_num[0, 0] = 1;

        DiceBase = (GameObject)Resources.Load("Dice");
        Dice     = GameObject.Find("Dice");
        dices.Add(Dice);  //リストにオブジェクトを追加
        Aqui = GameObject.Find("Aqui");
        objAquiController = Aqui.GetComponent <AquiController>();
        objDiceController = Dice.GetComponent <DiceController>();

        if (gameType == 3)
        {
            board[0, 0]     = -1;
            board_num[0, 0] = -1;
            maxDiceId       = 0;
            dices.Clear();
            Destroy(Dice);
        }

        StatusText    = GameObject.Find("StatusText");
        objStatusText = StatusText.GetComponent <StatusTextController>();
        ScreenText    = GameObject.Find("ScreenText");
        objScreenText = ScreenText.GetComponent <ScreenTextController>();

        gobjOGController = GameObject.Find("OnlineGameController");



        //BGM
        if (gameType != 2)
        {
            BgmManager.Instance.Play((stage + 1).ToString()); //BGM
        }
        else
        {
            BgmManager.Instance.Play("tutorial"); //BGM
        }

        //AudioSourceコンポーネントを取得し、変数に格納
        AudioSource[] audioSources = GetComponents <AudioSource>();
        sound_one     = audioSources[0];
        sound_levelup = audioSources[1];
        sound_vanish  = audioSources[2];
    }
示例#3
0
 void Awake()
 {
     //menuAudio = GetComponent<AudioSource>();
     restartTimer  = menuTimer;
     status_text   = StatusText.GetComponent <Text>();
     pauseLoader   = PauseButton.GetComponent <Transform>().FindChild("pause_Loader").GetComponent <Image>();
     playLoader    = PlayButton.GetComponent <Transform>().FindChild("play_Loader").GetComponent <Image>();
     restartLoader = RestartButton.GetComponent <Transform>().FindChild("restart_Loader").GetComponent <Image>();
     homeLoaderPM  = HomeButtonPM.GetComponent <Transform>().FindChild("home_Loader").GetComponent <Image>();
     homeLoaderGO  = HomeButtonGO.GetComponent <Transform>().FindChild("home_Loader").GetComponent <Image>();
 }
示例#4
0
    public void UpdatePeers(string peers)
    {
        if (PeerType == 1)
        {
            Debug.Log("Inside UpdatePeers");
            deviceList.Add(peers);
            GameObject button = (GameObject)Instantiate(buttonPrefab);
            button.transform.SetParent(parent.transform);
            button.transform.GetChild(0).GetComponent <Text>().text = peers;
            StatusText.GetComponent <Text>().text = "Connect to a Peer";

            button.GetComponent <Button>().onClick.AddListener(() => OnButtonClicked(peers));
        }
    }
示例#5
0
    public void UpdateMessage(string message)
    {
        if (PeerType == 2)
        {
            StatusText.GetComponent <Text>().text = message;
            Debug.Log(message);

            databaseReference = FirebaseDatabase.DefaultInstance.RootReference;
            databaseReference.Child("Users").Child(authReference.CurrentUser.UserId).Child("Connections").Push().Child("shared_card_id").SetValueAsync(message);

            DoneText.SetActive(true);
            DoneText.GetComponent <Text>().text = "New connection Formed !!";
            ViewProfileBtn.SetActive(true);
            PlayerPrefs.SetString("CARD_ID", message);
        }
    }
示例#6
0
 void Awake()
 {
     status_text = StatusText.GetComponent <Text>();
     healthbar   = HpBar.GetComponent <Transform>().FindChild("HealthBar").GetComponent <Image>();
 }
    void Update()
    {
        fightsWonText.GetComponent <Text>().text      = "Fights won: " + fightsWon;
        chickensBoughtText.GetComponent <Text>().text = "Chickens bought: " + chickensBought;
        chickensLostText.GetComponent <Text>().text   = "Chickens lost: " + chickensLost;
        moneyLostText.GetComponent <Text>().text      = "Money lost: " + moneyLost;
        moneyGainedText.GetComponent <Text>().text    = "Money gained: " + moneyGained;
        StatusText.GetComponent <Text>().text         = currentStatus;

        if (fightsWon <= 25)
        {
            currentStatus = "Chicken Nugget";
            StatusBackground.GetComponent <Image>().color = new Color32(152, 55, 56, 255);
            levelText.GetComponent <Text>().text          = ("Level 1");
        }

        if ((fightsWon > 25 && fightsWon <= 75) && moneyGained >= 10000)
        {
            currentStatus = "Chickapee";
            StatusBackground.GetComponent <Image>().color = new Color32(152, 55, 100, 255);
            levelText.GetComponent <Text>().text          = ("Level 2");
            marketPlaceUnlock = 1;
        }

        if ((fightsWon > 75 && fightsWon <= 200) && moneyGained >= 100000)
        {
            currentStatus = "Chocobo";
            StatusBackground.GetComponent <Image>().color = new Color32(137, 55, 152, 255);
            levelText.GetComponent <Text>().text          = ("Level 3");
            marketPlaceUnlock = 2;
        }

        if ((fightsWon > 200 && fightsWon <= 500) && moneyGained >= 500000)
        {
            currentStatus = "Ostrich";
            StatusBackground.GetComponent <Image>().color = new Color32(55, 78, 152, 255);
            levelText.GetComponent <Text>().text          = ("Level 4");
            marketPlaceUnlock = 3;
        }

        if ((fightsWon > 500 && fightsWon <= 1000) && moneyGained >= 1000000)
        {
            currentStatus = "Road Runner";
            StatusBackground.GetComponent <Image>().color = new Color32(55, 132, 152, 255);
            levelText.GetComponent <Text>().text          = ("Level 5");
            marketPlaceUnlock = 4;
        }

        if ((fightsWon > 1000 && fightsWon <= 2000) && moneyGained >= 5000000)
        {
            currentStatus = "War Emu";
            StatusBackground.GetComponent <Image>().color = new Color32(55, 152, 71, 255);
            levelText.GetComponent <Text>().text          = ("Level 6");
            marketPlaceUnlock = 5;
        }
        switch (marketPlaceUnlock)
        {
        case 1:
            MPUnlockBtn1Disabled.SetActive(false);
            MPUnlockBtn1LvlTxt.SetActive(true);
            break;

        case 2:
            MPUnlockBtn2Disabled.SetActive(false);
            MPUnlockBtn2LvlTxt.SetActive(true);
            break;

        case 3:
            MPUnlockBtn3Disabled.SetActive(false);
            MPUnlockBtn3text.GetComponent <Text>().text = "Coming soon";
            break;

        case 4:
            MPUnlockBtn4Disabled.SetActive(false);
            MPUnlockBtn4text.GetComponent <Text>().text = "Coming soon";
            break;

        case 5:
            MPUnlockBtn5Disabled.SetActive(false);
            MPUnlockBtn5text.GetComponent <Text>().text = "Coming soon";
            break;

        default:
            break;
        }
    }