Example #1
0
    private void SwitchState(StateOfResources stateFocused)
    {
        switch (stateFocused)
        {
        case StateOfResources.Available:
            break;

        case StateOfResources.Reloading:
            break;
        }
        stateResources = stateFocused;
    }
Example #2
0
    private void SwitchState(StateOfResources stateFocused)
    {
        switch (stateFocused)
        {
        case StateOfResources.Available:
            //DrawStateFeedBack(true);
            break;

        case StateOfResources.Reloading:
            roundNbrOfDesable = RoundManager.Instance.numberOfRound;
            // DrawStateFeedBack(false);
            SpriteRenderer sR = this.transform.GetChild(0).GetChild(0).GetComponent <SpriteRenderer>();
            sR.sprite = null;
            break;
        }
        stateResources = stateFocused;
    }
Example #3
0
    private void Regrow()
    {
        if (resourcesInfos != null && State != StateOfResources.Available)
        {
            if (this.avatarOnMe == true)
            {
                roundNbrOfDesable = RoundManager.Instance.numberOfRound;
            }
            bool neighbourWithSameType = CheckForSameTypeAround(neighbours);

            if (neighbourWithSameType == false)
            {
                if (State == StateOfResources.Reloading)
                {
                    tileType = TypeOfTile.None;
                    DrawVisualTile();
                }
            }
            if (resourcesInfos != null)
            {
                if (RoundManager.Instance.numberOfRound - roundNbrOfDesable >= resourcesInfos.nbrOfTurnsToRegrow)
                {
                    State = StateOfResources.Available;
                    SpriteRenderer sR = this.transform.GetChild(0).GetChild(0).GetComponent <SpriteRenderer>();
                    if (tileType != TypeOfTile.Mouflu && tileType != TypeOfTile.Rock)
                    {
                        sR.sprite = resourcesInfos.visualOfRegrowingResource[RoundManager.Instance.numberOfRound - roundNbrOfDesable];
                    }
                }
                else
                {
                    SpriteRenderer sR = this.transform.GetChild(0).GetChild(0).GetComponent <SpriteRenderer>();
                    if (tileType != TypeOfTile.Mouflu && tileType != TypeOfTile.Rock)
                    {
                        sR.sprite = resourcesInfos.visualOfRegrowingResource[RoundManager.Instance.numberOfRound - roundNbrOfDesable];
                    }
                }
            }
        }
    }