Exemplo n.º 1
0
    public void Enable(Transform initTransfrom, float damage, float speed, PropDamager damager)
    {
        this.damage  = damage;
        this.speed   = speed;
        this.damager = damager;

        timer.OnTimersFinished.AddListener(Disable);
        timer.StartWork();
        transform.SetPositionAndRotation(initTransfrom.position, initTransfrom.rotation);
        StartCoroutine(COROUTINE_MOVE);
    }
Exemplo n.º 2
0
    protected virtual void SetupComponents()
    {
        damager = gameObject.AddComponent <PropDamager>();

        foreach (PropWeaponUserBase user in propWeaponUsers)
        {
            user.Setup(damager);
        }

        propAbilityUser.Setup(damager);
    }
    public void Enable(Transform initTransfrom, float damage, float speed, PropDamager damager)
    {
        var newRot = Quaternion.Euler(initTransfrom.rotation.eulerAngles.x, initTransfrom.rotation.eulerAngles.y + 90, initTransfrom.rotation.eulerAngles.z);

        transform.SetPositionAndRotation(initTransfrom.position, newRot);

        gameObject.SetActive(true);

        this.damage  = damage;
        this.speed   = speed;
        this.damager = damager;

        timer.OnTimersFinished.AddListener(Disable);
        timer.StartWork();
        StartCoroutine(COROUTINE_MOVE);
    }