public virtual void ConnectToMenu(AbilityMenu menu, bool addAutoRun, bool addTakeBounty) { this.Menu.AddToMenu(menu); var enableItem = new AbilityMenuItem <bool>("Enable", true, "Enable automatic rune taking when in range"); enableItem.AddToMenu(this.Menu); enableItem.NewValueProvider.Subscribe(new DataObserver <bool>(b => this.Enabled = b)); this.Enabled = enableItem.Value; if (addAutoRun) { var autoRunForRune = new AbilityMenuItem <bool>( "AutoRunForBounty", false, "Run to closest bounty rune spot when its the time"); autoRunForRune.AddToMenu(this.Menu); autoRunForRune.NewValueProvider.Subscribe(new DataObserver <bool>(b => this.AutoRunToTake = b)); this.AutoRunToTake = autoRunForRune.Value; } if (addTakeBounty) { var takeBountyOnStart = new AbilityMenuItem <bool>( "TakeBountyOnStart", false, "Run to bounty rune spot on game start"); takeBountyOnStart.AddToMenu(this.Menu); takeBountyOnStart.NewValueProvider.Subscribe(new DataObserver <bool>(b => this.TakeBountyOnStart = b)); this.TakeBountyOnStart = takeBountyOnStart.Value; } }
// Use this for initialization void Start() { originalColor = background.color; abilityMenu = GameObject.FindGameObjectWithTag("AbilityScreen").GetComponent <AbilityMenu>(); if (slot == 2) { instance = this; } }
void Awake() { highlight = gameObject.GetComponent <Image>(); highlight.enabled = false; selected = false; usable = false; manager = GetComponentInParent <AbilityMenu>(); state = FindObjectOfType <GameState>(); GameEvents.current.onChangeMetal += SetUsable; }
void Start() { if (instance == null) { instance = this; } else { Destroy(this); } }
public void AddToMenu(AbilityMenu menu) { this.ParentMenu = menu; this.ParentMenu.Menu.AddSubMenu(this.Menu); }
public void AddToMenu(AbilityMenu menu) { this.ParentMenu = menu; menu.Menu.AddItem(this.MenuItem); }
// Use this for initialization void Start() { abilityScreen = GameObject.FindGameObjectWithTag("AbilityScreen").GetComponent <AbilityMenu>(); instances.Add(this); }
void Start() { abilityMenuUI = GameObject.Find("AbilityMenuCanvas").transform.Find("AbilityMenu").gameObject; abilityMenu = GameObject.Find("AbilityMenuCanvas").transform.Find("AbilityMenu").GetComponent <AbilityMenu>(); player = GameObject.Find("Player(Clone)"); }