//private bool neverSpitted = true; // Use this for initialization void Start() { hiddenPaintingRef = GetComponent <HiddenPainting>(); if (hiddenPaintingRef == null) { Debug.LogError("PaintSpitter COULD NOT FIND HiddenPainting ! Object : " + gameObject.name); } spitChannel = -1; }
void OnTriggerEnter(Collider other) { HiddenPainting hiddenPainting = null; if ((hiddenPainting = other.GetComponent <HiddenPainting>()) != null) { // Enter in a hidden painting zone pixelPainter.hiddenPaintingRef = hiddenPainting; } }
private void CheckHiddenPaintings(Vector3 pos, float radius, int colorIndex) { Collider[] colliders = Physics.OverlapSphere(pos, radius); for (int i = 0; i < colliders.Length; ++i) { HiddenPainting hp = colliders[i].GetComponent <HiddenPainting>(); if (hp != null) { hp.CheckRevealZone(pos.x, pos.y, radius, colorIndex); } } }
void OnTriggerExit(Collider other) { if (other.GetComponent <HiddenPainting>() != null) { // Exit a hidden painting zone if (pixelPainter != null) { hiddenPaintingRef = null; pixelPainter.hiddenPaintingRef = null; } } else if (affectedByClouds) { if (other.GetComponent <Cloud>() != null || other.name == "Moon") { ColorLevel = 1f; // Set color as charged } } }
void Start() { hiddenPaintingRef = gameObject.GetComponent <HiddenPainting>(); if (hiddenPaintingRef == null) { Debug.LogError("HiddenPaintingCompleteTrigger must be attached to a HiddenPainting !"); } if (objectToEnable == null) { Debug.LogError("You must set a target to HiddenPaintingCompleteTrigger !"); } // If a PaintSpitter is attached to the game object, // make thresholds match PaintSpitter ps = GetComponent <PaintSpitter>(); if (ps != null) { completeThreshold = ps.startThreshold; } }
void OnTriggerEnter(Collider other) { HiddenPainting hiddenPainting = null; Cloud cloud = null; if ((hiddenPainting = other.GetComponent <HiddenPainting>()) != null) { // Enter in a hidden painting zone if (pixelPainter != null || polyPainter != null) { hiddenPaintingRef = hiddenPainting; if (pixelPainter != null) { pixelPainter.hiddenPaintingRef = hiddenPainting; } } } else if (affectedByClouds) { if ((cloud = other.GetComponent <Cloud>()) != null) { // Set color but not charged yet if (Level.Get.levelID == 2) { SetColor(cloud.colorIndex, false); } else { SetColor(cloud.CurrentColor, false, false); } } else if (other.name == "Moon") { // Set moon color but not charged yet SetColor(Color.white, false, true); } } }