コード例 #1
0
    public void SwapBowl()
    {
        currentBowl = GameObject.FindGameObjectWithTag("Bowl").GetComponent <Bowl>();

        temp2.SetProgress(currentBowl);
        temp2.SetType(currentBowl);

        currentBowl.SetProgress(temp);
        currentBowl.SetType(temp);

        temp.SetProgress(temp2);
        temp.SetType(temp2);

        sprite = GetGameObjectSprite(currentBowl.gameObject);
        color  = GetGameObjectColor(currentBowl.gameObject);

        currentBowl.gameObject.GetComponent <SpriteRenderer>().sprite = bowlSprite;
        currentBowl.gameObject.GetComponent <SpriteRenderer>().color  = bowlColor;

        bowlSprite = sprite;
        bowlColor  = color;

        ChangeAppereance();

        LevelManager.instance.SetProgress();
    }
コード例 #2
0
    void Awake()
    {
        bowlSprite = GetGameObjectSprite(bowlCardStats.gameObject);
        bowlColor  = GetGameObjectColor(bowlCardStats.gameObject);

        sprite = bowlSprite;
        color  = bowlColor;

        t  = new GameObject();
        t2 = new GameObject();

        temp  = t.AddComponent <Bowl>();
        temp2 = t2.AddComponent <Bowl>();

        temp2.SetProgress(bowlCardStats);
        temp2.SetType(bowlCardStats);

        temp.SetProgress(bowlCardStats);
        temp.SetType(bowlCardStats);

        ChangeAppereance();
    }