public void NotifyClosestActivator(UIActivator activator) { if (this._activator != activator) { ProcessActivator(activator); } }
private void ChangeActiveUIElement(UIActivator newUIElement) { while (newUIElement.enabled = false) { newUIElement = newUIElement.UpActivator; } currentActivator.AppearanceChanger.SetInactive(); currentActivator = newUIElement; currentActivator.AppearanceChanger.SetActive(); cooldown = CooldownDuration; }
private void OnEnable() { if (!currentActivator) { currentActivator = GetComponentInChildren <UIActivator>(); } if (currentActivator.AppearanceChanger == null) { currentActivator.AppearanceChanger = currentActivator.GetComponent <UIAppearanceChanger>(); } currentActivator.AppearanceChanger.SetActive(); }
// Methods protected override void Build() { // Get GameObjects Prefab = PrefabUtils.CopyPrefab(BaseItem); Prefab.name = NamePrefix + Name; GameObject uiAct = Prefab.transform.Find("techActivator/triggerActivate").gameObject; // Load Components LandPlot plot = Prefab.GetComponent <LandPlot>(); UIActivator activator = uiAct.GetComponent <UIActivator>(); // Setup Components plot.typeId = ID; activator.uiPrefab = UIPrefab ?? activator.uiPrefab; }
private void ProcessActivator(UIActivator activator) { if (!this.isActiveAndEnabled) { return; } if (GetUnsignedWorldPointActivationVolumeDistance(activator.transform.position) < this.transform.InverseTransformVector(Vector3.up * activator.WorldRadius).magnitude) { _activator = activator; } else { _activator = null; } }
public void Clear() { activator = null; distance = float.PositiveInfinity; }
bool GetObjectValue (GameObject obj, UIActivator objActivator) { UIActivator activator = objActivator; if (activator != null) { activator.Update(); return activator.mLastState; } else { return obj.activeSelf; } }