コード例 #1
0
    //add attack animation when this occurs
    private void OnTriggerEnter(Collider other)
    {
        if (DeadCount == -1)
        {
            DeadCount = 0;
        }
        if (other.transform.tag == "NPC")
        {
            // there is where we can spawn the blood pool when the player dies...
            Destroy(other.gameObject);
            DeadCount++;
            SetDeadCount();
        }

        if (other.transform.tag == "distraction")
        {
            camera     = GameObject.FindGameObjectWithTag("MainCamera");
            ballScript = camera.GetComponent <ThrowDistraction>();
            Debug.Log(ballScript);
            // there is where we can spawn the blood pool when the player dies...
            if (ballScript.isThrown)
            {
                Destroy(other.gameObject);
                ballScript.isThrown = false;
            }
        }
    }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     player                 = GameObject.FindGameObjectWithTag("Player").transform;
     signCounter            = GameObject.FindGameObjectWithTag("sign count").transform;
     ballCounter            = GameObject.FindGameObjectWithTag("ball count").transform;
     startTime              = Time.time;
     mailData               = new List <string>();
     throwDistractionScript = Camera.main.GetComponent <ThrowDistraction>();
     hospitalLightScript    = player.GetComponent <HospitalLight>();
 }