コード例 #1
0
    public void Collect(Collectable.CollectType type)
    {
        switch (type)
        {
        case Collectable.CollectType.CAN:
            audioSource.clip = canAudio;
            break;

        case Collectable.CollectType.ORANGE:
            audioSource.clip = orangeAudio;
            break;

        case Collectable.CollectType.APPLE:
            audioSource.clip = appleAudio;
            break;

        case Collectable.CollectType.SUGAR:
            audioSource.clip = sugarAudio;
            break;

        case Collectable.CollectType.WATER:
            audioSource.clip = waterAudio;
            break;

        case Collectable.CollectType.LOVE:
            audioSource.clip = loveAudio;
            break;

        default:
            Debug.Log("Collectable does not contain that CollectType");
            break;
        }

        audioSource.Play();
    }
コード例 #2
0
ファイル: PlayerMan.cs プロジェクト: SebsonOnGitHub/Gameadero
 public void CollectIngredient(Collectable.CollectType ingredient)
 {
     FindObjectOfType <GameMaster>().collectInWorld--;
     if (!ingredientsCollected.Contains(ingredient))
     {
         ingredientsCollected.Add(ingredient);
         mainCollected = ingredientsCollected.Count;
     }
 }
コード例 #3
0
 public CollectableSpawnDetail(Collectable.CollectType collType, int collXPos)
 {
     this.Type = collType;
     this.CollectXPos = collXPos;
     this.Spawned = false;
 }