コード例 #1
0
        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;
            }
        }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     originalColor = background.color;
     abilityMenu   = GameObject.FindGameObjectWithTag("AbilityScreen").GetComponent <AbilityMenu>();
     if (slot == 2)
     {
         instance = this;
     }
 }
コード例 #3
0
 void Awake()
 {
     highlight         = gameObject.GetComponent <Image>();
     highlight.enabled = false;
     selected          = false;
     usable            = false;
     manager           = GetComponentInParent <AbilityMenu>();
     state             = FindObjectOfType <GameState>();
     GameEvents.current.onChangeMetal += SetUsable;
 }
コード例 #4
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
コード例 #5
0
 public void AddToMenu(AbilityMenu menu)
 {
     this.ParentMenu = menu;
     this.ParentMenu.Menu.AddSubMenu(this.Menu);
 }
コード例 #6
0
 public void AddToMenu(AbilityMenu menu)
 {
     this.ParentMenu = menu;
     menu.Menu.AddItem(this.MenuItem);
 }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     abilityScreen = GameObject.FindGameObjectWithTag("AbilityScreen").GetComponent <AbilityMenu>();
     instances.Add(this);
 }
コード例 #8
0
 void Start()
 {
     abilityMenuUI = GameObject.Find("AbilityMenuCanvas").transform.Find("AbilityMenu").gameObject;
     abilityMenu   = GameObject.Find("AbilityMenuCanvas").transform.Find("AbilityMenu").GetComponent <AbilityMenu>();
     player        = GameObject.Find("Player(Clone)");
 }