private void OnTriggerStay(Collider other) { if (Input.GetButton("Interact") && !m_triggerOnceInteract && other.gameObject.CompareTag("InteractObject")) { m_triggerOnceInteract = true; Baguette baguette = other.gameObject.GetComponent <Baguette>(); if (baguette) { baguette.m_audioSource.Stop(); baguette.m_audioSource.PlayOneShot(baguette.m_sound); } if (other.gameObject.GetComponent <Dialogue>()) { m_dialogueManager.StartDialogue(other.gameObject.GetComponent <Dialogue>()); } } else if (other.gameObject.CompareTag("Water")) { StartCoroutine(RespawnWater()); } else if (other.gameObject.CompareTag("Balloon")) { m_numberBalloons += 1; Destroy(other.gameObject); } }
// Use this for initialization void Start() { if (gameObject.tag != "localPlayer") { return; } PVMax = 100; PV = PVMax; Mort = false; bloodImage = BloodScreen.GetComponent <Image>(); BloodScreenOpacity = 0f; couleurBloodScreen = new Color(1f, 1f, 1f, 0f); attaque = Couteau.GetComponent <Attaque>(); furryScript = Couteau.GetComponent <Furry>(); baguette = Couteau.GetComponent <Baguette>(); weaponchange = gameObject.GetComponent <WeaponChange>(); fpsCam = GameObject.FindWithTag("localCamera").GetComponent <Camera>(); }