Example #1
0
 void Start()
 {
     if (isLocalPlayer)
     {
         gameObject.tag       = "LocalPlayer";
         _body                = GetComponent <Rigidbody2D>();
         _collider            = GetComponent <BoxCollider2D>();
         _currentInteractable = null;
         if (!isInLobby)
         {
             Messenger <float> .Broadcast(GameEvent.PLAYER_STARTS, gameObject.transform.position.x);
         }
         vcamera        = GameObject.FindWithTag("CameraSet").GetComponent <CinemachineVirtualCamera>();
         vcamera.Follow = transform;
         healthBarObject.SetActive(false);
         textCanvas.SetActive(false);
         nameText.text = "";
         CmdSetUpName(PlayerPrefs.GetString("Name"));
         if (!isInLobby)
         {
             Messenger <int> .AddListener(GameEvent.DISTANCE_INCREASED, OnDistanceIncreased);
         }
         inputAvailabilityManager = GameObject.FindWithTag("InputAvailabilityManager").GetComponent <InputAvailabilityManager>();
     }
     else
     {
         nameText.text = playerName;
         arrow.SetActive(false);
         if (isInLobby)
         {
             healthBarObject.SetActive(false);
             textCanvas.SetActive(false);
         }
     }
 }
Example #2
0
 void Start()
 {
     keyText.text             = interactionKey.ToString();
     inputAvailabilityManager = GameObject.FindWithTag("InputAvailabilityManager").GetComponent <InputAvailabilityManager>();
     button.onClick.AddListener(ChangeState);
     UpdateState();
 }
Example #3
0
    private void Start()
    {
        var o = GameObject.FindWithTag("InputAvailabilityManager");

        if (o != null)
        {
            inputAvailabilityManager = o.GetComponent <InputAvailabilityManager>();
        }
        MessengerInternal.DEFAULT_MODE = MessengerMode.DONT_REQUIRE_LISTENER;
    }
Example #4
0
 private void Start()
 {
     UpdateDisplay();
     inputAvailabilityManager = GameObject.FindWithTag("InputAvailabilityManager").GetComponent <InputAvailabilityManager>();
 }