Exemple #1
0
    protected virtual IHealth Spawn(Vector3 pos)
    {
        var obj = GenericObjectPooler.RequestObject(objectToSpawn, false);

        obj.transform.localScale = targetScale;
        obj.transform.position   = pos;
        obj.gameObject.SetActive(true);
        IHealth health = obj.gameObject.GetComponent <IHealth>();

        health.FillToMaxHealth();
        Debug.DrawLine(pos, pos + Vector3.up * 10, Color.red, 1f);
        return(health);
    }
Exemple #2
0
    public override void CreateTrail(ShootInfo shootInfo)
    {
        Vector3 start = weaponFirepos.GetWeaponFirePos();
        Vector3 end   = shootInfo.end;

        start = NagaUtils.GetPointAlongDirection(start, end - start, Random.value * startposRandomness);

        TrailRenderer trail = GenericObjectPooler.RequestObject(trailRenderer).gameObject.GetComponent <TrailRenderer>();

        trail.gameObject.transform.position = start;
        trail.gameObject.SetActive(true);

        trail.Clear();

        Timing.RunCoroutine(_TweenTrail(trail, end));
    }