Пример #1
0
    public void OnCollisionEnter(Collider[] others)
    {
        foreach (Collider otherCollider in others)
        {
            Soul otherSoul = otherCollider.GetComponentInParent <Soul>();

            if (otherSoul != null)
            {
                // Broken soul catch healthy soul
                // Broke every soul we touch <3
                otherSoul.Broke();
                this.soul.SetTargetToFollow(null);
            }
        }
    }
Пример #2
0
    private void Start()
    {
        // Instantiate all souls
        for (uint soulIndex = 0; soulIndex < this.brokenSoulsAmount + this.healthySoulsAmount; soulIndex++)
        {
            Soul soul = this.InstantiateSoul(this.GetRandomNavMeshPosition());

            if (soulIndex < this.brokenSoulsAmount)
            {
                soul.Broke();
                this.CurrentBrokenSoulsAmount++;
            }
            else
            {
                soul.Repair();
                this.CurrentNormalSoulsAmount++;
            }
        }

        this.gameHasStarted = true;
        this.userInterface.OnSoulRatioChanged(this);

        // StartCoroutine(this.PositionDebuggingCoroutine());
    }