public bool IsHiddenPaintingTrigger() { if (hiddenPainting == null) { return(false); } else { if (hiddenPainting.GetRevealRatio(checkedChannel) > threshold) { return(false); } else { return(true); } } }
// Update is called once per frame void Update() { // Update spit type sbyte newSpitChannel = -1; // By default, none will be active for (sbyte chnl = 0; chnl < 3; ++chnl) { // Check each channel until one is widely revealed if (hiddenPaintingRef.GetRevealRatio(chnl) > startThreshold) { newSpitChannel = chnl; if (newSpitChannel != spitChannel) { //sound SoundLevel2.Instance.FeedbackVisages(gameObject, newSpitChannel); } break; } } spitChannel = newSpitChannel; // Update spitting if (spitChannel != -1) // If a valid channel has been set { float t = Time.time; if (t >= nextSpitTime) // If it's the time to spawn a spit { // Spawn it //Debug.Log("Spit " + spitChannel); nextSpitTime = t + spawnIntervalSeconds.Rand(); PaintSpitManager.Instance.SpawnPaintSpit( transform.position, configs[spitChannel], spitChannel); /*if(neverSpitted) * { * neverSpitted = false; * }*/ } } }
void Update() { if (triggered) { return; } if (hiddenPaintingRef.GetRevealRatio(channel) > completeThreshold) { Helper.SetActive(objectToEnable, true); triggered = true; switch (Level.Get.levelID) { case 1: CommonSounds.Instance.HornetBirth(); break; case 2: break; } } }