Exemple #1
0
    public void Init(string name, int number)
    {
        playerString = name;
        playerNumber = number;

        portrait = null;
        health   = settings.PlayerHealth;
        //_selectedType = new TileTypes();
        //_selectedType.Type = TileTypes.ESubState.yellow;
        _type1 = new TileTypes();
        _type2 = new TileTypes();
        _type3 = new TileTypes();
        _type4 = new TileTypes();

        _type1.Type = TileTypes.ESubState.blue;
        _type2.Type = TileTypes.ESubState.green;
        _type3.Type = TileTypes.ESubState.red;
        _type4.Type = TileTypes.ESubState.yellow;
        turn        = 0;
        type1Power  = 0;
        type2Power  = 0;
        type3Power  = 0;
        type4Power  = 0;

        colors = new List <Transform>();
    }
Exemple #2
0
    public void AddPortrait(Unit unit)
    {
        GameObject obj = Instantiate(m_portraitPrefab);

        obj.transform.SetParent(gameObject.transform);
        PortraitUI portraitUI = obj.GetComponent <PortraitUI>();

        portraitUI.m_parent = this;

        portraitUI.SetUnit(unit);
        m_portraits.Add(portraitUI);
    }
Exemple #3
0
    /*public void SelectColorByIndex(int index)
     * {
     *  if ((TileTypes.ESubState.yellow + index) != _selectedType.Type)
     *  {
     *      _selectedType.Type = TileTypes.ESubState.yellow + index;
     *  }
     * }*/

    public void SetUI(Transform transform)
    {
        this.transform = transform;
        if (transform.Find("PortraitHP"))
        {
            this.portrait = transform.Find("PortraitHP").GetComponent <PortraitUI>();
        }


        transform.Find("Color1").GetComponent <SpecialPowerUI>().UpdateText(type1Power);
        transform.Find("Color2").GetComponent <SpecialPowerUI>().UpdateText(type2Power);
        transform.Find("Color3").GetComponent <SpecialPowerUI>().UpdateText(type3Power);
        transform.Find("Color4").GetComponent <SpecialPowerUI>().UpdateText(type4Power);

        colors.Add(transform.Find("Color1"));
        colors.Add(transform.Find("Color2"));
        colors.Add(transform.Find("Color3"));
        colors.Add(transform.Find("Color4"));
    }