const float CoolDownTime = .25f; //time it takes for the cooldown // Use this for initialization void Start() { grenadeCoolDown = gameObject.GetComponent <Timer>(); //event for changing enabled tool in UI selectionChangeEvent = new ToolbeltEvent(); //adding this script as an invoker for changing enabled tool in UI EventManager.AddSelectionChangeStasisGrenadeInvokers(this); //event for updating the count for the Grenade tool in the UI updateCountEvent = new ToolbeltCountUpdateUI(); //adding this script as an invoker to the update count UI event EventManager.AddUpdateStasisGrenadeInvokers(this); }
// Use this for initialization void Start() { pingDeviceCount = 0; //event for changing the selection on the UI changeSelectionEvent = new ToolbeltEvent(); //event for updating count for tool in UI updateCountEvent = new ToolbeltCountUpdateUI(); //adding this script as Invokers to the two UI events EventManager.AddSelectionChangePingDeviceInvokers(this); EventManager.AddUpdatePingDeviceCountInvokers(this); }
/// <summary> /// Used to initialize variables /// </summary> void Start() { //event for changing the selection on the UI changeSelectionEvent = new ToolbeltEvent(); //event for updating count for tool in UI updateCountEvent = new ToolbeltCountUpdateUI(); //adding this script as Invokers to the two UI events EventManager.AddSelectionChangeTripWireInvokers(this); EventManager.AddUpdateTripWireCountInvokers(this); //since a Unity tile unit is 1 for height and width //we want the explosion radius to be within 1.5 files explosionRadius = 2.121f; //distance of 2 tiles to use for placement //this is used for determining how far the //second part of trip wire can be placed before it destroys itself placementRadius = 2.828f; }
private void Start() { //event for changing selected tool in the toolbelt UI changeSelectionEvent = new ToolbeltEvent(); //event for disabling the UI for toolbelt when all tools are disabled disableEvent = new DisableToolBeltUI(); //add this script as an invoker to the two above events EventManager.AddDisableAllToolsUIInvokers(this); EventManager.AddSelectionChangeInputInvokers(this); tripWireChecked = false; stasisGrenadeChecked = false; pingDeviceChecked = false; enabledTool = Constants.Tools.StasisGrenade; //by default set tripwire as enabled tool allToolsDisabled = true; //start of game disable all tools //event invoked to disable all tools in the UI disableEvent.Invoke(); }