public override void OnEnable()
    {
        base.OnEnable();

        if (inputController == null)
        {
            inputController = GetComponentInParent <InputController>();
        }

        if (itemController == null)
        {
            itemController = GetComponentInParent <ItemController>();
        }

        if (_vision == null)
        {
            _vision = GetComponentInParent <Vision>();
        }

        if (_vision.HasTargets)                                                           ///_vision.targets.transforms != null && _vision.targets.transforms.Count > 0)
        {
            target_InputController = _vision.targets[0].GetComponent <InputController>(); //_vision.targets.transforms[0].GetComponent<InputController>();
        }
        if (pRef == null)
        {
            pRef = GetComponentInParent <ProjectileRef>();
        }
    }
Exemplo n.º 2
0
 public virtual bool PreShoot(Player player, Vector2 position, Vector2 velocity, ProjectileRef proj, int damage, float knockback)
 {
     return(true);
 }
Exemplo n.º 3
0
        public bool PreShoot(Player plr, Vector2 p, Vector2 v, ProjectileRef pr, int d, float kb)
        {
            var r = HookManager.Call(preShoot, plr, p, v, pr, d, kb);

            return(r.Length == 0 || r.All(Convert.ToBoolean));
        }