void Start() { label = GetComponent <Text>(); entity = Dependancy.Get <Entity>(gameObject, Dependancy.Scope.RecursiveToParents); entity.OnHealthChange += OnChange; UpdateState(); }
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); }
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); }
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); }
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; }
public virtual void CalculateBounds() { var customBounds = Dependancy.Get <EntityCustomBounds>(gameObject); if (customBounds == null) { Bounds = Tools.Bounds.FromCollider2D(gameObject); } else { Bounds = customBounds.Value; } }
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; }
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); }
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); }
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>(); }
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); } }
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; } }
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); }
protected virtual void Reset() { point = transform; line = Dependancy.Get <LineRenderer>(gameObject); }
protected virtual void GetDependancies() { Bar = Dependancy.Get <ProgressBar>(gameObject, Dependancy.Scope.RecursiveToParents); }
protected virtual void Reset() { target = Dependancy.Get <Page>(gameObject, Dependancy.Scope.RecursiveToParents); }
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); }
protected virtual void Reset() { audioSource = Dependancy.Get <AudioSource>(gameObject); }
protected virtual void Awake() { weapon = Dependancy.Get <Weapon>(gameObject, Dependancy.Scope.RecursiveToParents); weapon.OnAction += Action; }
public override void Configure(Proponent reference) { base.Configure(reference); Selection = Dependancy.Get <ProponentUnitsSelection>(gameObject); }
public override void Configure(PlayerUI data) { base.Configure(data); Creator = Dependancy.Get <ProponentUnitsCreatorUI>(gameObject); }
public override void Configure(Base data) { base.Configure(data); Slots = Dependancy.Get <BaseTowerSlots>(gameObject); }
protected virtual void Reset() { system = Dependancy.Get <ParticleSystem>(gameObject); }
protected virtual void Awake() { Entity = GetComponent <Entity>(); collider = Dependancy.Get <SphereCollider>(gameObject); }
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; }