Ejemplo n.º 1
0
    private Transform[] CollectAllTransforms(AoEDamageEvent aoeEvent)
    {
        Transform[] aiTransforms     = AI_Behaviour.GetEnemiesWithinRadius(aoeEvent.SourcePosition, aoeEvent.Radius);
        Transform[] barrelTransforms = Barrel.GetBarrelsWithinRadius(aoeEvent.SourcePosition, aoeEvent.Radius);
        Transform[] all = new Transform[aiTransforms.Length + barrelTransforms.Length + 1];
        aiTransforms.CopyTo(all, 0);
        barrelTransforms.CopyTo(all, 0);

        if (Vector3.Distance(PlayerController.Position, aoeEvent.SourcePosition) < aoeEvent.Radius)
        {
            Transform playerTransform = PlayerController.GameObject.transform;
            all[all.Length - 1] = playerTransform;
        }

        return(all);
    }