Beispiel #1
0
 public new void Start()
 {
     anim             = new IconAnimator();
     animalSprites    = Resources.LoadAll <Sprite>("Animals");
     cries            = Resources.LoadAll <AudioClip>("AnimalSounds");
     arrowIcon        = Resources.Load <Texture>("Menu/arrow");
     arrowFlippedIcon = Resources.Load <Texture>("Menu/arrow-flipped");
     this.curAnimal   = PlayerPrefs.GetInt("animal");
     this.playerName  = PlayerPrefs.GetString("name");
     base.Start();
 }
Beispiel #2
0
    public new void Start()
    {
        this.logo = Resources.Load <Texture>("Menu/logo");
        anim      = new IconAnimator();

        Sprite[] animalSprites = Resources.LoadAll <Sprite>("Animals");
        this.curAnimal = PlayerPrefs.GetInt("animal");
        this.icons [0] = animalSprites [curAnimal].texture;
        this.icons [1] = Resources.Load <Texture> ("Menu/credits");
        this.icons [2] = Resources.Load <Texture> ("Menu/rules");

        this.loadInstructionPages();

        this.hostIP = null;
        base.Start();
    }
Beispiel #3
0
    public new void Start()
    {
        this.logo = Resources.Load<Texture>("Menu/logo");
        anim = new IconAnimator ();

        Sprite[] animalSprites = Resources.LoadAll<Sprite>("Animals");
        this.curAnimal = PlayerPrefs.GetInt("animal");
        this.icons [0] = animalSprites [curAnimal].texture;
        this.icons [1] = Resources.Load<Texture> ("Menu/credits");
        this.icons [2] = Resources.Load<Texture> ("Menu/rules");

        this.loadInstructionPages ();

        this.hostIP = null;
        base.Start();
    }
Beispiel #4
0
    // --------------- Drag & Drop ---------------

    public override void Initialize()
    {
        base.Initialize();

        GameAccesPoint.Instance.hudGUIState = this;
        GameAccesPoint.Instance.managerSystem.stateManager.guiStates.Add(this);

        // --------------- Root Setup ---------------
        hudGUI = gameObject;
        hudGUI.transform.SetParent(uiRoot);
        hudGUI.transform.position = uiRoot.position;
        // --------------- Root Setup ---------------

        GameObject tmpBar = GameObject.Find("r_HealthBar");

        if (tmpBar != null)
        {
            healthBar = tmpBar.GetComponent <Image>();
        }

        tmpBar = GameObject.Find("r_HungerBar");
        if (tmpBar != null)
        {
            hungerBar = tmpBar.GetComponent <Image>();
        }

        tmpBar = GameObject.Find("r_ThirstBar");
        if (tmpBar != null)
        {
            thirstBar = tmpBar.GetComponent <Image>();
        }

        tmpBar = GameObject.Find("r_EnergyBar");
        if (tmpBar != null)
        {
            energyBar = tmpBar.GetComponent <Image>();
        }

        tmpBar = GameObject.Find("r_HungerIcon");
        if (tmpBar != null)
        {
            hungerIcon = tmpBar.GetComponent <Image>();
        }
        tmpBar = GameObject.Find("r_ThirstIcon");
        if (tmpBar != null)
        {
            thirstIcon = tmpBar.GetComponent <Image>();
        }
        tmpBar = GameObject.Find("r_EnergyIcon");
        if (tmpBar != null)
        {
            energyIcon = tmpBar.GetComponent <Image>();
        }

        tmpBar = GameObject.Find("r_HealthIcon");
        if (tmpBar != null)
        {
            healthIconAnim = GameObject.Find("r_HealthIcon").GetComponent <IconAnimator>();
        }
        if (healthBar == null || hungerBar == null || thirstBar == null || energyBar == null || healthIconAnim == null)
        {
            Debug.LogError("One of the bars could not be found.");
        }

        amountText = GameObject.Find("r_Amount_Text").GetComponent <Text>();
        rButton    = GameObject.Find("r_Right_Button").GetComponent <Button>();
        lButton    = GameObject.Find("r_Left_Button").GetComponent <Button>();

        rButton.onClick.AddListener(OnRightButtonClicked);
        lButton.onClick.AddListener(OnLeftButtonClicked);

        isInit = true;
    }