void Start()
        {
            label = GetComponent <Text>();

            entity = Dependancy.Get <Entity>(gameObject, Dependancy.Scope.RecursiveToParents);

            entity.OnHealthChange += OnChange;

            UpdateState();
        }
Exemplo n.º 2
0
        public virtual void Configure(Proponent data)
        {
            Proponent = data;

            Units   = Dependancy.Get <BaseUnits>(gameObject);
            Tower   = Dependancy.Get <BaseTower>(gameObject);
            Graphic = Dependancy.Get <BaseGraphic>(gameObject);

            Modules.Configure(this);
        }
Exemplo n.º 3
0
        public override void Configure(WorldUI data)
        {
            base.Configure(data);

            Levels     = Dependancy.Get <LevelsUIList>(gameObject);
            Difficulty = Dependancy.Get <RegionDifficultyContextUI>(gameObject);

            Selection = new WorldCore.SelectionData();

            Modules.Configure(this);
        }
Exemplo n.º 4
0
        public override void Configure(UnitsUI data)
        {
            base.Configure(data);

            Character = Dependancy.Get <UnitCharacterUI>(gameObject);

            Iterator = Dependancy.Get <UnitContextIteratorUI>(gameObject);

            Initial = Dependancy.Get <UnitContextInitialUI>(gameObject);

            Upgrade = Dependancy.Get <UnitContextUpgradeUI>(gameObject);
        }
Exemplo n.º 5
0
        private void Reset()
        {
            flowchart = Dependancy.Get <Flowchart>(gameObject);

            if (flowchart == null)
            {
                var gameObject = new GameObject(nameof(Flowchart));

                gameObject.transform.SetParent(transform);

                flowchart = gameObject.AddComponent <Flowchart>();
            }
        }
            public virtual void Init()
            {
                transition = Dependancy.Get <UITransition>(gameObject, Dependancy.Scope.RecursiveToParents);

                if (transition == null)
                {
                    throw new NullReferenceException("Cannot find UI Transition for module: " + name + " to use");
                }

                UpdateState(transition.Value);

                transition.OnValueChanged += OnValueChanged;
            }
Exemplo n.º 7
0
        public virtual void CalculateBounds()
        {
            var customBounds = Dependancy.Get <EntityCustomBounds>(gameObject);

            if (customBounds == null)
            {
                Bounds = Tools.Bounds.FromCollider2D(gameObject);
            }
            else
            {
                Bounds = customBounds.Value;
            }
        }
Exemplo n.º 8
0
        protected override void Awake()
        {
            base.Awake();

            audio      = Dependancy.Get <UnitAudio>(gameObject);
            Controller = Dependancy.Get <UnitController>(gameObject);
            Body       = Dependancy.Get <UnitBody>(gameObject);
            Navigator  = Dependancy.Get <UnitNavigator>(gameObject);
            Attack     = Dependancy.Get <UnitAttack>(gameObject);
            Speed      = Dependancy.Get <UnitSpeed>(gameObject);

            Modules.Configure(this);
        }
        public virtual void Init()
        {
            Button = GetComponent <Button>();

            CooldownBar = Dependancy.Get <ProgressBar>(gameObject);

            GrayscaleController = new UIGrayscaleController(this);

            Button.onClick.AddListener(OnClick);

            CooldownBar.Value = 0f;

            Proponent.Energy.OnValueChanged += OnEnergyChanged;
        }
Exemplo n.º 10
0
        protected virtual void Awake()
        {
            Abilities = Dependancy.Get <ProponentAbilities>(gameObject);

            Units = Dependancy.Get <ProponentUnits>(gameObject);

            Energy = Dependancy.Get <ProponentEnergy>(gameObject);

            Modules.Configure(this);

            Base = Dependancy.Get <Base>(gameObject);

            Enemy = Level.Proponents.GetOther(this);
        }
Exemplo n.º 11
0
        UICoreMenu Create()
        {
            var instance = Object.Instantiate(prefab);

            Object.DontDestroyOnLoad(instance);

            instance.name = "UI Core Menu";

            var script = Dependancy.Get <UICoreMenu>(instance);

            script.Init();

            return(script);
        }
Exemplo n.º 12
0
        protected virtual void Awake()
        {
            Instance = this;

            Points = Dependancy.Get <LevelPoints>(gameObject);

            Pause = Dependancy.Get <LevelPause>(gameObject);

            camera = FindObjectOfType <LevelCamera>();


            Planet = FindObjectOfType <Planet>();

            Player = FindObjectOfType <Player>();

            Menu = FindObjectOfType <GameMenu>();

            Spawner = FindObjectOfType <Spawner>();
        }
Exemplo n.º 13
0
        public override void Configure(Unit data)
        {
            base.Configure(data);

            Animator = Dependancy.Get <Animator>(gameObject);

            AnimationEvents = Dependancy.Get <AnimationEvents>(gameObject);

            Character = Dependancy.Get <Character4D>(gameObject);

            CharacterAnimation = Dependancy.Get <CharacterAnimation>(gameObject);

            var controls = Dependancy.Get <CharacterControls>(gameObject);

            if (controls != null)
            {
                Destroy(controls);
            }
        }
Exemplo n.º 14
0
        protected virtual void Reset()
        {
            var sizeFitter = Dependancy.Get <ContentSizeFitter>(gameObject);

            if (sizeFitter != null)
            {
                panel = sizeFitter.transform as RectTransform;

                if (sizeFitter.verticalFit == ContentSizeFitter.FitMode.PreferredSize)
                {
                    axis = AxisTarget.Y;
                }
                else if (sizeFitter.horizontalFit == ContentSizeFitter.FitMode.PreferredSize)
                {
                    axis = AxisTarget.X;
                }

                MaxSize = PanelSize;
            }
        }
Exemplo n.º 15
0
        protected virtual void Awake()
        {
            Core.PlayFab.EnsureActivation();

            Instance = this;

            Pause      = Dependancy.Get <LevelPause>(gameObject);
            Speed      = Dependancy.Get <LevelSpeed>(gameObject);
            Proponents = Dependancy.Get <LevelProponents>(gameObject);

            Menu = FindObjectOfType <LevelMenu>();
            Menu.Configure(this);

            Background = Dependancy.Get <LevelBackground>(gameObject);
            Finish     = Dependancy.Get <LevelFinish>(gameObject);
            Timer      = Dependancy.Get <LevelTimer>(gameObject);

            camera = FindObjectOfType <GameCamera>();

            Modules.Configure(this);
        }
Exemplo n.º 16
0
        protected virtual void Reset()
        {
            point = transform;

            line = Dependancy.Get <LineRenderer>(gameObject);
        }
Exemplo n.º 17
0
 protected virtual void GetDependancies()
 {
     Bar = Dependancy.Get <ProgressBar>(gameObject, Dependancy.Scope.RecursiveToParents);
 }
Exemplo n.º 18
0
 protected virtual void Reset()
 {
     target = Dependancy.Get <Page>(gameObject, Dependancy.Scope.RecursiveToParents);
 }
Exemplo n.º 19
0
        protected virtual void Awake()
        {
            toggle = Dependancy.Get <Toggle>(gameObject, Dependancy.Scope.RecursiveToParents);

            toggle.onValueChanged.AddListener(OnChange);
        }
 public virtual void Init()
 {
     Label = Dependancy.Get <Text>(gameObject);
 }
Exemplo n.º 21
0
 protected virtual void Reset()
 {
     audioSource = Dependancy.Get <AudioSource>(gameObject);
 }
Exemplo n.º 22
0
        protected virtual void Awake()
        {
            weapon = Dependancy.Get <Weapon>(gameObject, Dependancy.Scope.RecursiveToParents);

            weapon.OnAction += Action;
        }
Exemplo n.º 23
0
        public override void Configure(Proponent reference)
        {
            base.Configure(reference);

            Selection = Dependancy.Get <ProponentUnitsSelection>(gameObject);
        }
Exemplo n.º 24
0
        public override void Configure(PlayerUI data)
        {
            base.Configure(data);

            Creator = Dependancy.Get <ProponentUnitsCreatorUI>(gameObject);
        }
Exemplo n.º 25
0
        public override void Configure(Base data)
        {
            base.Configure(data);

            Slots = Dependancy.Get <BaseTowerSlots>(gameObject);
        }
 protected virtual void Reset()
 {
     system = Dependancy.Get <ParticleSystem>(gameObject);
 }
Exemplo n.º 27
0
        protected virtual void Awake()
        {
            Entity = GetComponent <Entity>();

            collider = Dependancy.Get <SphereCollider>(gameObject);
        }
Exemplo n.º 28
0
 protected virtual void Reset()
 {
     current = Dependancy.Get <UIElement>(gameObject, Dependancy.Scope.RecursiveToParents);
 }
        protected virtual void Awake()
        {
            projectile = Dependancy.Get <Projectile>(gameObject, Dependancy.Scope.RecursiveToParents);

            projectile.CollisionEnterEvent += Collision;
        }