public void ChangeMinAppearance(MinsType mintype)
    {
        switch (mintype)
        {
        case MinsType.Block:
            playerSpriteRenderer.sprite = playerBlockSprite;
            break;

        case MinsType.Floor:
            playerSpriteRenderer.sprite = playerFloorSprite;
            break;

        case MinsType.Burst:
            playerSpriteRenderer.sprite = playerBurstSprite;
            break;

        case MinsType.Projectile:
            playerSpriteRenderer.sprite = playerProjectileSprite;
            break;

        default:
            playerSpriteRenderer.sprite = playerOriginalSprite;
            break;
        }
    }
示例#2
0
    public MinLight GetMins(MinsType minType)
    {
        if (!MinsPoolContainer.ContainsKey(minType))
        {
            return(null);
        }

        var      minList = MinsPoolContainer[minType];
        MinLight minGot  = null;

        foreach (var minLight in minList)
        {
            //TODO find a better way to keep them active/inactive. Active doing their job. Inactive is disabled or just following the player.
            if (!minLight.gameObject.activeSelf)
            {
                minLight.gameObject.SetActive(true);
                minLight.GetComponent <Collider>().enabled = true;
                minGot = minLight;
                minGot.transform.parent = null;
                break;
            }
        }

        return(minGot);
    }
示例#3
0
    private void CycleCurrentMinType()
    {
        var currentMinInt = (int)currentMinType;

        currentMinInt++;
        currentMinInt %= numTypes;
        currentMinType = (MinsType)currentMinInt;
        playerAppearance.ChangeMinAppearance(currentMinType);
        currentDeployState = currentDeployState.NextState;
    }
示例#4
0
    public MinSpawnLight GetSpawn(MinsType minType)
    {
        if (!MinsSpawnConainer.ContainsKey(minType))
        {
            return(null);
        }

        var           minSpawnList = MinsSpawnConainer[minType];
        MinSpawnLight spawnGot     = null;

        foreach (var minSpawn in minSpawnList)
        {
            if (!minSpawn.gameObject.activeSelf)
            {
                minSpawn.gameObject.SetActive(true);
                minSpawn.GetComponent <Collider>().enabled = true;
                spawnGot = minSpawn;
                spawnGot.transform.parent = null;
                break;
            }
        }

        return(spawnGot);
    }