コード例 #1
0
ファイル: Sword_Script.cs プロジェクト: sKm-games/LudumDare44
 void Start()
 {
     _playerInput = transform.parent.parent.GetComponent <PlayerInput_Script>();
     _playerInv   = _playerInput.GetComponent <PlayerInv_Script>();
     _swordPivot  = transform.parent;
     _audioSource = _playerInv.GetComponent <AudioSource>();
 }
コード例 #2
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "Player")
     {
         PlayerInv_Script pi = col.GetComponent <PlayerInv_Script>();
         if (pi.BloodAmount < pi.MaxBloodAmount)
         {
             pi.GainBlood(BloodValue);
             Destroy(this.gameObject);
         }
     }
 }
コード例 #3
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "Player")
     {
         Debug.Log("Player at bed");
         if (_playerInv == null)
         {
             _playerInv = col.GetComponent <PlayerInv_Script>();
         }
         _allowInteraction = true;
         PlanetBedInfoScreen.SetActive(true);
         UpdateInfoText();
     }
 }
コード例 #4
0
 void Start()
 {
     _playerInv          = FindObjectOfType <PlayerInv_Script>();
     _playerInput        = _playerInv.GetComponent <PlayerInput_Script>();
     _sword              = _playerInv.transform.GetComponentInChildren <Sword_Script>();
     _gameManangerScript = _playerInv.GameManagScript;
     _infoTextScreen     = ShopButtons[0].transform.parent.parent.GetChild(2).gameObject;
     _infoText           = _infoTextScreen.GetComponentInChildren <TextMeshProUGUI>();
     _audioSource        = GetComponent <AudioSource>();
     ShopUI.SetActive(false);
     UpdateBloodBankUI();
     _shopButtonsTexts = new List <TextMeshProUGUI>();
     SetUpButtons();
 }