Example #1
0
    void FindMe()
    {
        GameObject[] players = GameObject.FindGameObjectsWithTag("Player");

        if(myPlayer == null)
        {
            foreach (GameObject player in players)
            {
                if (player.GetComponent<NetworkIdentity>().isLocalPlayer)
                {
                    dankInteract = player.GetComponentInChildren<DankInteract>();
                    dankInventory = player.GetComponent<DankInventory>();
                    //dankPlayerNetwork = player.GetComponent<PlayerNetwork>();
                    myPlayer = player;
                    break;
                }
            }
        }
        else
        {
            isInteracted = (dankInteract.currentTarget == gameObject);
        }
    }
Example #2
0
    void Start()
    {
        if (!isLocalPlayer)
        {
            return;
        }

        dankInventory = GetComponent<DankInventory>();
    }