public void OnShowButton(ButtonEventData buttonEventData) { if (this.button.type == buttonEventData.buttonType) { this.button.SetVisible(); } }
/// <summary> /// Automatically called by CalendarButton whenever the button recieves click events (left/right), and is sent to the Calendar for processing. /// </summary> public void SendClickEvents(PointerEventData eventData, ButtonEventData buttonData) { if (eventData.button == PointerEventData.InputButton.Left) { if (eventData.clickCount < 2) { if (OnButtonClicked != null) { OnButtonClicked(buttonData); } } else { if (OnButtonDoubleClicked != null) { OnButtonDoubleClicked(buttonData); } } } else if (eventData.button == PointerEventData.InputButton.Right) { if (OnButtonRightClicked != null) { OnButtonRightClicked(buttonData); } } }
private void Replace(IButton button, ButtonEventData eventData, MeshCollider mc) { if (CheckReplacementBoundsSetting()) { World.BeginUndoBatch("Replace MeshCollider"); switch (replacementColliderComponent.Value) { case ReplacementColliderComponent.BoxCollider: var bc = mc.Slot.AttachComponent <BoxCollider>(); bc.CreateSpawnUndoPoint(); SetupNewCollider(bc, mc); break; case ReplacementColliderComponent.SphereCollider: var sc = mc.Slot.AttachComponent <SphereCollider>(); sc.CreateSpawnUndoPoint(); SetupNewCollider(sc, mc); break; case ReplacementColliderComponent.ConvexHullCollider: mc.Slot.AttachComponent <ConvexHullCollider>().CreateSpawnUndoPoint(); break; } mc.UndoableDestroy(); World.EndUndoBatch(); PopulateList(); ShowResults($"MeshCollider replaced."); } else { ShowResults($"{replacementColliderComponent.Value} cannot be used with {setupBoundsType.Value}"); } }
public void OnHideButton(ButtonEventData buttonEventData) { if (this.button.type == buttonEventData.buttonType) { this.button.SetInvisible(); } }
public void OnUnpressButton(ButtonEventData buttonEventData) { if (this.button.type == buttonEventData.buttonType) { this.button.SetPressable(); } }
private void RaiseShowFightButtonEvent() { ButtonEventData buttonEventData = new ButtonEventData(); buttonEventData.buttonType = ButtonTypes.Fight; this.showButton.Raise(buttonEventData); }
private void RaiseHideArrangeButtonEvent() { ButtonEventData buttonEventData = new ButtonEventData(); buttonEventData.buttonType = ButtonTypes.Arrange; this.hideButton.Raise(buttonEventData); }
private void RaiseShowDefaultButtonEvent(Button button) { ButtonEventData buttonEventData = new ButtonEventData(); buttonEventData.button = button; this.showDefaultButton.Raise(buttonEventData); }
private void RaiseHideFightButtonEvent() { ButtonEventData buttonEventData = new ButtonEventData(); buttonEventData.buttonType = ButtonTypes.Fight; this.hideButton.Raise(buttonEventData); }
private void RaiseHideEndTurnButtonEvent() { ButtonEventData buttonEventData = new ButtonEventData(); buttonEventData.buttonType = ButtonTypes.EndTurn; this.hideButton.Raise(buttonEventData); }
private void RaiseUnpressFightButtonEvent() { ButtonEventData buttonEventData = new ButtonEventData(); buttonEventData.buttonType = ButtonTypes.Fight; this.unpressButton.Raise(buttonEventData); }
public void OnShowActiveButton(ButtonEventData buttonEventData) { if (this.button == buttonEventData.button) { this.button.SetActiveSprite(); this.button.SetActive(); } }
public void OnShowDefaultButton(ButtonEventData buttonEventData) { if (this.button == buttonEventData.button) { this.button.SetDefaultSprite(); this.button.SetInactive(); } }
private void RaiseUnpressArrangeButtonEvent() { ButtonEventData buttonEventData = new ButtonEventData(); buttonEventData.buttonType = ButtonTypes.Arrange; this.unpressButton.Raise(buttonEventData); }
private void PopulateList(IButton button, ButtonEventData eventData) { _count = 0; _scrollAreaRoot.DestroyChildren(); ForeachMeshCollider(delegate(MeshCollider mc) { CreateScrollListElement(mc); _count++; }); ShowResults($"{_count} matching MeshColliders listed."); }
// public void CreateRandomPet(GameObject pet) // { // int max = Random.Range(2,5); // int dayt = Random.Range(5,15); // petToSet = new Pet(petToSet.name,5, max,max,max,max,max,dayt,dayt/5,dayt/3, dayt , // dayt/dayt,Actions.StayStill, petMeshes[Random.Range(0,petMeshes.Count)], // spriteParents,pointLists,Animations.Idle,petParticles,petMeshMaterials,originalMaterial); // pet.GetComponent<PetInfo>().SetPetInfo(petToSet); // } public void GivePet(ButtonEventData data) { data.buttonAnimator.SetTrigger("OnClick"); data.petTarget.actualPetInfo.petActions = data.action; data.petTarget.actualPetInfo.PerformAction(); data.petTarget.actualPetInfo.UpdateVisuals(data.petTarget.actualPetInfo.waterLvl, data.petTarget.actualPetInfo.pointsLists.waterPoints); data.petTarget.actualPetInfo.UpdateVisuals(data.petTarget.actualPetInfo.foodLvl, data.petTarget.actualPetInfo.pointsLists.foodPoints); data.petTarget.actualPetInfo.UpdateVisuals(data.petTarget.actualPetInfo.happynessLvl, data.petTarget.actualPetInfo.pointsLists.gamesPoints); data.petTarget.actualPetInfo.UpdateVisuals(data.petTarget.actualPetInfo.energyLvl, data.petTarget.actualPetInfo.pointsLists.sleepPoints); data.petTarget.InstantiateParticle(data.petTarget.actualPetInfo.petActions); }
private void ReplaceAll(IButton button, ButtonEventData eventData) { if (CheckReplacementBoundsSetting()) { World.BeginUndoBatch("Batch replace MeshColliders"); _count = 0; ForeachMeshCollider(delegate(MeshCollider mc) { switch (replacementColliderComponent.Value) { case ReplacementColliderComponent.BoxCollider: var bc = mc.Slot.AttachComponent <BoxCollider>(); bc.CreateSpawnUndoPoint(); SetupNewCollider(bc, mc); break; case ReplacementColliderComponent.SphereCollider: var sc = mc.Slot.AttachComponent <SphereCollider>(); sc.CreateSpawnUndoPoint(); SetupNewCollider(sc, mc); break; case ReplacementColliderComponent.ConvexHullCollider: var chc = mc.Slot.AttachComponent <ConvexHullCollider>(); chc.CreateSpawnUndoPoint(); SetupNewCollider(chc, mc); break; case ReplacementColliderComponent.CapsuleCollider: var capc = mc.Slot.AttachComponent <CapsuleCollider>(); capc.CreateSpawnUndoPoint(); SetupNewCollider(capc, mc); break; case ReplacementColliderComponent.CylinderCollider: var cylc = mc.Slot.AttachComponent <CylinderCollider>(); cylc.CreateSpawnUndoPoint(); SetupNewCollider(cylc, mc); break; } mc.UndoableDestroy(); _count++; }); World.EndUndoBatch(); PopulateList(); ShowResults($"{_count} matching MeshColliders replaced with {replacementColliderComponent.ToString()}s."); } else { ShowResults($"{replacementColliderComponent.Value} cannot be used with {setupBoundsType.Value}"); } }
private void RemoveAll(IButton button, ButtonEventData eventData) { World.BeginUndoBatch("Batch remove MeshColliders"); _count = 0; ForeachMeshCollider(delegate(MeshCollider mc) { mc.UndoableDestroy(); _count++; }); World.EndUndoBatch(); PopulateList(); ShowResults($"{_count} matching MeshColliders removed."); }
private void RemoveLogixReferences(IButton button, ButtonEventData eventData) { _count = 0; if (ProcessRoot.Target != null) { foreach (LogixReference componentsInChildren in ProcessRoot.Target.GetComponentsInChildren <LogixReference>()) { componentsInChildren.Destroy(); _count++; } ShowResults($"{_count} LogixReference components removed."); } else { ShowResults("No ProcessRoot Slot set."); } }
private void Remove(IButton button, ButtonEventData eventData, MeshCollider mc) { mc.UndoableDestroy(); PopulateList(); ShowResults($"MeshCollider removed."); }
public void SetCalendar(Calendar targetCalendar, ButtonEventData eventData) { calendar = targetCalendar; data = eventData; }
private void JumpTo(IButton button, ButtonEventData eventData, Slot s) { LocalUserRoot.JumpToPoint(s.GlobalPosition); }
private void GeneratePressed(IButton button, ButtonEventData eventData) { StartTask(async() => { await GenerateNew(); }); }
private void Highlight(IButton button, ButtonEventData eventData, Slot s) { HighlightHelper.FlashHighlight(s, null, HighlightColor, HighlightDuration); }