コード例 #1
0
ファイル: GameSystem.cs プロジェクト: SofianeB98/Guardians
 public override void OnEvent(KillFeedEvent evnt)
 {
     if (!evnt.RemoveFeed)
     {
         AddKillFeed(evnt.Message);
     }
 }
コード例 #2
0
    private void CheckPlayer()
    {
        Collider[] col = Physics.OverlapBox(this.laserGO.transform.position, this.laserGO.transform.localScale / 2,
                                            this.laserGO.transform.rotation, this.checkLayer);
        if (col.Length > 0 && col != null)
        {
            for (int i = 0; i < col.Length; i++)
            {
                Guardian g = col[i].GetComponent <Guardian>();
                if (g != null)
                {
                    if (!g.IsInvinsible && !g.IsDie)
                    {
                        string s = myOwner.GetComponent <Guardian>().guardianName + " kills " + g.guardianName;

                        g.TakeDamage(this.damage);
                        Debug.Log("Gardian toucher");

                        if (g != myOwner.GetComponent <Guardian>())
                        {
                            myOwner.GetComponent <Guardian>().UpdateScore(false, "Enemy burned", true);
                        }
                        else
                        {
                            //myOwner.GetComponent<Guardian>().UpdateScore(true);
                            s = myOwner.GetComponent <Guardian>().guardianName + " kills himself !";
                        }


                        var evnt = KillFeedEvent.Create(GameSystem.GSystem.entity);
                        evnt.Message    = s;
                        evnt.RemoveFeed = false;
                        evnt.Send();

                        return;
                    }

                    return;
                }
            }
        }
        return;
    }
コード例 #3
0
ファイル: Guardian.cs プロジェクト: SofianeB98/Guardians
    public void CheckVide()
    {
        //if (this.currentInventorySeed < this.maxSeedInInventory)
        {
            Collider[] col = Physics.OverlapSphere(this.feetPosition.position, 1.25f, this.videLayerMask);

            if (col.Length > 0)
            {
                this.TakeDamage(1);
                string s = guardianName + " is lost in the Void !";

                if (this.lastGuardianWhoHitMe != null)
                {
                    s = lastGuardianWhoHitMe.guardianName + " push " + guardianName + " in the void !";
                    lastGuardianWhoHitMe.UpdateScore(false, "Enemy pushed", false);
                }

                var evnt = KillFeedEvent.Create(GameSystem.GSystem.entity);
                evnt.Message    = s;
                evnt.RemoveFeed = false;
                evnt.Send();
            }
        }
    }