Beispiel #1
0
    public void Interact(Inventory _inventory)
    {
        if (m_Type == PointType.Box)
        {
            if (_inventory.AddBox(m_BoxRef))
            {
                m_BoxRef.PickUp();
                _inventory.m_Player.m_RotController.AssignTarget(m_BoxRef.m_Goal.transform, m_BoxRef.m_Goal);
                SpawnManager.Instance.RecycleSpawnPoint((SpawnPoint)this);
                SpriteRegen(false);
            }

            return;
        }

        if (m_Type == PointType.Target)
        {
            if (_inventory.RemoveBox(m_BoxRef))
            {
                _inventory.ApplyScore(m_BoxRef.m_Score);
                _inventory.m_Player.m_RotController.RemoveTarget(m_BoxRef.m_Goal);
                AudioManager.Instance.PlayDropOffSnd();
                m_BoxRef.Recycle();
                SpawnManager.Instance.RecycleSpawnPoint((SpawnPoint)this);
                SpriteRegen(true);
            }
        }
    }
    public void Interact(Inventory _inventory)
    {
        if(m_Type==PointType.Box)
        {
            if(_inventory.AddBox(m_BoxRef))
            {
                m_BoxRef.PickUp();
                _inventory.m_Player.m_RotController.AssignTarget(m_BoxRef.m_Goal.transform, m_BoxRef.m_Goal);
                SpawnManager.Instance.RecycleSpawnPoint((SpawnPoint)this);
                SpriteRegen (false);
            }

            return;
        }

        if(m_Type==PointType.Target)
        {
            if(_inventory.RemoveBox(m_BoxRef))
            {
                _inventory.ApplyScore(m_BoxRef.m_Score);
                _inventory.m_Player.m_RotController.RemoveTarget(m_BoxRef.m_Goal);
                AudioManager.Instance.PlayDropOffSnd();
                m_BoxRef.Recycle();
                SpawnManager.Instance.RecycleSpawnPoint((SpawnPoint)this);
                SpriteRegen (true);

            }
        }
    }