Inheritance: MonoBehaviour
Exemplo n.º 1
0
    private void Update()
    {
        if (following)
        {
            if (timeSinceLastAttack > 0)
            {
                timeSinceLastAttack -= Time.deltaTime;
            }

            if (attackTargets.Count == 0)
            {
                attackGraphic.enabled = false;
            }
            else
            {
                attackGraphic.enabled = true;
                attackGraphic.SetPosition(0, transform.position);
                attackGraphic.SetPosition(1, primaryTarget.transform.position);

                if (timeSinceLastAttack <= 0)
                {
                    timeSinceLastAttack += 1f;
                    HudDisplay.AddPower(this, -powerDrained);
                    powerContained -= powerDrained;
                    if (powerContained <= 0)
                    {
                        Destroy(gameObject);
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
    private void OnTriggerEnter(Collider other)
    {
        if (!following && other.gameObject.tag == "Player")
        {
            HudDisplay.AddPower(this, powerContained);
            following = true;
            transform.SetParent(other.transform);

            goToMover.target = other.transform;
            colorize.LightUp = true;
            MusicBehaviour.SpeedUp();
            return;
        }

        Shadow otherShadow = other.gameObject.GetComponent <Shadow>();

        if (following && otherShadow != null && !attackTargets.Contains(otherShadow))
        {
            attackTargets.Add(otherShadow);
            if (primaryTarget == null)
            {
                primaryTarget = otherShadow;
                otherShadow.SlowDown();
                MusicBehaviour.SpeedUp();
            }
        }
    }
Exemplo n.º 3
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
     gameObject.name = "$HudDisplay";
 }
Exemplo n.º 4
0
        /// <summary>
        /// Called when the assembly is loaded.
        /// </summary>
        public static void OnLoad()
        {
            Variables.Menu = new Menu("DZAwareness", "dz191.dza", true);
            LogHelper.OnLoad();
            HudDisplay.OnLoad();

            foreach (var module in Variables.Modules)
            {
                module.OnLoad();
            }

            Variables.Menu.AddToMainMenu();

            ImageLoader.InitSprites();
            foreach (var element in HudVariables.HudElements)
            {
                element.OnLoad();
                element.InitDrawings();
            }

            DZAwareness.OnLoad();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Called when the assembly is loaded.
        /// </summary>
        public static void OnLoad()
        {
            Variables.Menu = new Menu("DZAwareness", "dz191.dza", true);



            LogHelper.OnLoad();
            HudDisplay.OnLoad();

            foreach (var enemy in HeroManager.Allies)
            {
                ImageLoader.AddedHeroes.Add(enemy.ChampionName, new HeroHudImage(enemy.ChampionName));
            }

            foreach (var module in Variables.Modules)
            {
                module.OnLoad();
            }

            Variables.Menu.AddToMainMenu();

            DZAwareness.OnLoad();
        }
Exemplo n.º 6
0
        /// <summary>
        /// Called when the assembly is loaded.
        /// </summary>
        public static void OnLoad()
        {
            Variables.Menu = MainMenu.AddMenu("DZAwareness", "dz191.dza");
            LogHelper.OnLoad();
            HudDisplay.OnLoad();

            foreach (var module in Variables.Modules)
            {
                module.OnLoad();
            }

            ImageLoader.InitSprites();

            foreach (var element in HudVariables.HudElements)
            {
                element.OnLoad();
                element.InitDrawings();
            }

            DZAwareness.OnLoad();

            Chat.Print("<font color='#2675A9'>DZ</font>Awareness Loaded: Remember to enable the HUD in the Options!");
        }
 public HudDisplayUpdate(HudDisplay hudDisplay, T data)
 {
     this.HudDisplay = hudDisplay;
     this.Data       = data;
 }
Exemplo n.º 8
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
     AddPower(null, 0);
     ShowIntro();
 }