示例#1
0
    public void DecideIfHighlighted(SelectabilityState selectState)
    {
        string sSprPath = "Images/Chrs/imgGlow";

        switch (selectState)
        {
        case SelectabilityState.NONE:
            //No additional suffix needed for the path
            break;

        case SelectabilityState.ALLYSELECTABLE:
            sSprPath += "4";
            break;

        case SelectabilityState.ENEMYSELECTABLE:
            sSprPath += "6";
            break;

        default:
            Debug.Log("Unrecognized SelectabilityState: " + selectState);
            break;
        }

        LibView.AssignSpritePathToObject(sSprPath, this.gameObject);
    }
示例#2
0
    public void DisplayIcon()
    {
        string sSprPath = "Images/Chrs/" + mod.chrOwner.sName + "/img";

        if (mod != null)
        {
            sSprPath += mod.sName;
        }

        LibView.AssignSpritePathToObject(sSprPath, goIcon);
    }
示例#3
0
    public GameObject AddManaIcon(Mana.MANATYPE manaType, bool bPaidFor, Mana.MANATYPE manaPaidWith = Mana.MANATYPE.EFFORT)
    {
        GameObject goManaIcon = new GameObject(string.Format("sprManaIcon{0}", lstgoManaIcons.Count));

        goManaIcon.transform.parent = goRequiredManaPosition.transform;

        SpriteRenderer sprRen = goManaIcon.AddComponent <SpriteRenderer>();

        //Assign the appropriate sprite
        LibView.AssignSpritePathToObject(GetManaIconSpritePath(manaType, bPaidFor, manaPaidWith), goManaIcon);

        //Sacle the icon apropriately
        goManaIcon.transform.localScale = new Vector3(fManaSymbolSize, fManaSymbolSize, 1);

        //Place the icon at the appropriate spot
        goManaIcon.transform.localPosition = new Vector3(fManaSymbolSpacing * (0.5f + 1.5f * lstgoManaIcons.Count), 0f, 0f);

        //Ensure the symbol appears ahead of the mana panel
        sprRen.sortingOrder = 1;

        lstgoManaIcons.Add(goManaIcon);

        return(goManaIcon);
    }
示例#4
0
 public void ReplaceManaIcon(int indexToReplace, Mana.MANATYPE manaType, bool bPaidFor, Mana.MANATYPE manaPaidWith = Mana.MANATYPE.EFFORT)
 {
     LibView.AssignSpritePathToObject(GetManaIconSpritePath(manaType, bPaidFor, manaPaidWith), lstgoManaIcons[indexToReplace]);
 }