Пример #1
0
    private void Awake()
    {
        playerMovement = GetComponent <PlayerMovement>();
        playerCarry    = GetComponent <PlayerCarry>();

        camTransform = Camera.main.transform;
    }
Пример #2
0
 private void Awake()
 {
     if (CarryInstance == null)
     {
         DontDestroyOnLoad(this);
         CarryInstance = this;
     }
     else
     {
         if (CarryInstance != this)
         {
             Destroy(gameObject);
         }
     }
 }
Пример #3
0
    private void Start()
    {
        playerCarry = (PlayerCarry)FindObjectOfType(typeof(PlayerCarry));
        List <string> playerUnlocks = playerCarry.getPlayerUnlocks();

        foreach (string ball in playerUnlocks)
        {
            GameObject.Find(ball).tag = "Unlocked";
        }

        itemSlotArray = GameObject.FindGameObjectsWithTag("Unlocked");
        foreach (GameObject ball in itemSlotArray)
        {
            ball.transform.GetChild(1).gameObject.SetActive(true);
        }
    }
Пример #4
0
    private void Start()
    {
        playerCarry = GameObject.Find("PlayerCarry").GetComponent <PlayerCarry>();

        if (playerCarry.getPlayerUnlock() != null)
        {
            Debug.Log(playerCarry.getPlayerUnlock());
            GameObject.Find(playerCarry.getPlayerUnlock()).tag = "Unlocked";
        }

        itemSlotArray = GameObject.FindGameObjectsWithTag("Unlocked");
        foreach (GameObject ball in itemSlotArray)
        {
            ball.transform.GetChild(1).gameObject.SetActive(true);
        }
    }
Пример #5
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            PlayerCarry player = other.GetComponent <PlayerCarry>();
            if (player == null)
            {
                return;
            }

            if (!player.Carrying)
            {
                player.itemAvailable = this.gameObject;
            }
        }
    }
Пример #6
0
    public void setBall(string ball)
    {
        PlayerCarry carry = (PlayerCarry)FindObjectOfType(typeof(PlayerCarry));

        carry.GetComponent <PlayerCarry>().setPlayerChoice(ball);
    }