public override void Awake() { base.Awake(); if (!CylinderBounds) { Debug.LogErrorFormat("{0} does not have a cylinder trigger bounds!", gameObject.name); } bevent = GetComponent <InteractiveEvent>(); Transform temptrans; temptrans = transform.Find("Shell"); if (temptrans) { ShellMaterial = temptrans.GetComponent <MeshRenderer>().material; } temptrans = transform.Find("Inner"); if (temptrans) { FlowerMaterial = temptrans.GetComponent <MeshRenderer>().material; } CandleLights = GetComponentsInChildren <Light>(); }
public override void DisableEvents() { Destroy(bevent); bevent = null; disabled = true; disabledscale = transform.localScale; fadeDuration = disableTime; }
public override void Awake() { base.Awake(); var events = GetComponents <InteractiveEvent>(); if (events.Length >= 1) { onevent = events[0]; } if (events.Length >= 2) { offevent = events[1]; } }
public override void Awake() { base.Awake(); rigidbody = GetComponent <Rigidbody>(); collider = GetComponent <BoxCollider>(); var mesht = transform.Find("Inner"); if (mesht) { materialInner = mesht.GetComponent <MeshRenderer>().material; standardInnerColor = materialInner.color; } var meshs = transform.Find("Shell"); if (meshs) { materialShell = meshs.GetComponent <MeshRenderer>().material; standardShellColor = materialShell.color; } var spriter = transform.Find("Aura"); if (spriter) { spriteRendererMain = spriter.GetComponent <SpriteRenderer>(); spriteRendererInner = spriter.GetChild(0).GetComponent <SpriteRenderer>(); } var events = GetComponents <InteractiveEvent>(); if (events.Length >= 1) { pickupEvent = events[0]; } if (events.Length >= 2) { dropEvent = events[1]; } }
public override void Awake() { base.Awake(); bevent = GetComponent <InteractiveEvent>(); var etransform = GameObjectExtender.FindChildWithTag(transform, "Main Material"); if (etransform) { var ecomp = etransform.GetComponent <MeshRenderer>(); if (ecomp) { OrbMaterial = ecomp.material; } var lcomp = etransform.GetComponent <Light>(); if (lcomp) { OrbLight = lcomp; } Deselect(null); } }
public override void DisableEvents() { Destroy(bevent); bevent = null; disabled = true; }