Gem.getDescription C# (CSharp) Method

getDescription() public method

public getDescription ( ) : string
return string
    public string getDescription()
    {
        return description;
    }

Usage Example

Exemplo n.º 1
0
    //include setters for manually setting stats
    void PickedUp(Player player)
    {
        switch (gemType)
        {
            case 1:
                gem = new StrengthGem();
                break;
            case 2:
                gem = new AgilityGem();
                break;
            case 3:
                gem = new IntelligenceGem();
                break;
            case 4:
                gem = new HealthGem();
                break;
            case 5:
                gem = new ManaGem();
                break;
            case 6:
                Debug.Log("Would be skill Gem");
                //insert skill gem here when done
                break;
        }
        gem.setOwner(player);

        gem.Initialize(quality);  //MUST CALL. think of this as running the Start() function, but Gem does not inherit from monobehaviour. Its its own man, taking orders from no base class.
        Debug.Log(gem.getDescription());
        //Set stats for gem before adding to play

        player.GetComponent<GemManager>().addGem(gem);
        Destroy(gameObject);
    }