Ejemplo n.º 1
0
        public virtual void Show(Proponent winner)
        {
            if (winner is PlayerProponent)
            {
                info.text = Core.Localization.Phrases.Get("level win dialog");

                if (Data.Level.IsLast)
                {
                    next.gameObject.SetActive(false);
                    retry.gameObject.SetActive(false);
                }
                else
                {
                    var canGoToNext = Data.Level.Next.UnlockedOn(Data.Difficulty);

                    next.gameObject.SetActive(canGoToNext);
                    retry.gameObject.SetActive(false);
                }
            }
            else
            {
                info.text = Core.Localization.Phrases.Get("level lose dialog");

                next.gameObject.SetActive(false);
                retry.gameObject.SetActive(true);
            }

            Show();
        }
Ejemplo n.º 2
0
        public virtual void Process(Proponent winner)
        {
            Level.Speed.Value = 0.2f;

            Core.Audio.Player.Music.Stop();

            this.winner = winner;

            if (winner is PlayerProponent)
            {
                Core.Audio.Player.SFX.PlayOneShot(SFX.Win);

                if (PlayFab.IsOnline)
                {
                    Request();
                }
                else
                {
                    End();
                }
            }
            else
            {
                Core.Audio.Player.SFX.PlayOneShot(SFX.Lose);

                End();
            }

            if (OnProcess != null)
            {
                OnProcess(winner);
            }
        }
Ejemplo n.º 3
0
 void ProponentDefeated(Proponent proponent)
 {
     if (OnDefeat != null)
     {
         OnDefeat(proponent);
     }
 }
        public override void Configure(Proponent reference)
        {
            base.Configure(reference);

            Elements = new List <ProponentAbility>();

            Selection = Dependancy.Get <ProponentAbilitiesSelection>(gameObject);
        }
Ejemplo n.º 5
0
        public virtual void Configure(Proponent leader, IUnitSelectionData data)
        {
            this.Leader = leader;

            this.Template = data.Template;

            Upgrades = Dependancy.Get <UnitUpgrades>(gameObject);
            Upgrades.Set(data.Upgrades);
        }
Ejemplo n.º 6
0
        public override void Configure(Proponent reference)
        {
            base.Configure(reference);

            List = new Element[Player.Units.Selection.Max];

            for (int i = 0; i < List.Length; i++)
            {
                List[i] = new Element(i);
            }
        }
Ejemplo n.º 7
0
        public virtual Proponent GetOther(Proponent proponent)
        {
            if (proponent == player)
            {
                return(_AI);
            }

            if (proponent == _AI)
            {
                return(player);
            }

            throw new NotImplementedException();
        }
Ejemplo n.º 8
0
        public virtual Ability Spawn(Proponent user)
        {
            var instance = Instantiate(prefab);

            instance.name = prefab.name;

            instance.transform.position = prefab.transform.position;
            instance.transform.rotation = prefab.transform.rotation;

            var script = instance.GetComponent <Ability>();

            script.Configure(user, this);
            script.Init();

            return(script);
        }
Ejemplo n.º 9
0
 public virtual void Configure(Proponent user, AbilityTemplate template)
 {
     this.User     = user;
     this.Template = template;
 }
Ejemplo n.º 10
0
        public override void Configure(Proponent reference)
        {
            base.Configure(reference);

            Selection = Dependancy.Get <ProponentUnitsSelection>(gameObject);
        }
        public override void Configure(Proponent user, AbilityTemplate template)
        {
            base.Configure(user, template);

            Elements = new List <Projectile>();
        }
Ejemplo n.º 12
0
 void OnProponentDeafeated(Proponent proponent)
 {
     Finish.Process(Proponents.GetOther(proponent));
 }