Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        scoreValue = 0;

        rend      = GetComponent <SpriteRenderer>();
        cap       = GetComponentInChildren <CapsuleCollider2D>();
        playerBox = playerColl.GetComponent <BoxCollider2D>();

        playerBox.enabled = false;

        baseScale = new Vector3(startingScaleVal, startingScaleVal, startingScaleVal); //starting values for text

        currentState = DigState.UNDUG;
        updateGraveState();

        graveText.text = scoreValue.ToString();
        //graveText.material.color = new Color(graveText.material.color.r, graveText.material.color.g, graveText.material.color.b, 1.0f);
    }
Ejemplo n.º 2
0
        private DigStateDto GetDigStateDto(DigState digState)
        {
            if (digState == null)
            {
                return(new DigStateDto
                {
                    hasDigState = false
                });
            }

            return(new DigStateDto
            {
                hasDigState = true
                , depth = digState.Depth
                , fuel = (int)digState.Fuel
                , isPaused = digState.IsPaused > 0 ? true : false
                , nearbyMonsters = GetNearbyMonstersDto(digState.NearbyMonster.ToList())
            });
        }
Ejemplo n.º 3
0
    public void updateGraveState()
    {
        if (currentState <= DigState.DUG)
        {
            currentState = DigState.DUG;
            rend.sprite  = dugSprite;
            cap.enabled  = true;
            //playerBox.enabled = false;

            GameObject dirt = Instantiate(dirtParticles, transform.position + new Vector3(0, 0, 1), Quaternion.identity);
        }
        if (currentState >= DigState.UNDUG)
        {
            currentState = DigState.UNDUG;
            rend.sprite  = undugSprite;
            cap.enabled  = false;
            //playerBox.enabled = true;

            GameObject dirt = Instantiate(dirtParticles, transform.position + new Vector3(0, 0, 1), Quaternion.identity);
        }
    }