Esempio n. 1
0
    private void maybeUseSpawnableObject()
    {
        SpawnablePlatform platform = WrenchMageInventory.GetInstance().GetSpawnablePlatform();

        if (platform != null)
        {
            anim.SetTrigger("spawning");
            Instantiate(platform, transform.position, Quaternion.identity);
        }
    }
    public SpawnablePlatform GetSpawnablePlatform()
    {
        if (currentViewingIndex == -1)
        {
            return(null);
        }
        SpawnablePlatform result = inventory[currentViewingIndex];

        inventory.RemoveAt(currentViewingIndex);
        currentViewingIndex--;
        return(result);
    }
 public void addItem(SpawnablePlatform platform)
 {
     inventory.Add(platform);
     currentViewingIndex = inventory.Count - 1;
 }