コード例 #1
0
    private void OnTriggerEnter(Collider other)
    {
        playerShip playerShip = other.gameObject.GetComponent <playerShip>();

        if (playerShip != null)
        {
            playerShip.Kill();
        }
    }
コード例 #2
0
 void Awake()
 {
     if (ship == null)
     {
         ship = this;   //set ship singleton
     }
     else
     {
         Debug.LogError("Hero.Awake() - Attempted to assign second Hero.Ship!");
     }
     //fireDelegate += TempFire;
 }
コード例 #3
0
 // Start is called before the first frame update
 void Start()
 {
     health_score = GetComponent <TextMeshProUGUI>();
     playerHealth = FindObjectOfType <playerShip>();
 }