public void Init(Vector3 _position, CARDINAL _direction, PROJTYPE _type, float _speed) { transform.position = _position; direction = _direction; speed = _speed; type = _type; spriteRenderer.sprite = sprites[(int)type]; }
public void Init(Vector3 _position, CARDINAL _direction, PROJTYPE _type, float _speed) { rectTransform.position = _position; direction = _direction; speed = _speed; type = _type; spriteRenderer.sprite = sprites[(int)type]; transform.eulerAngles = DirectionDict.rotDict[direction]; }
public void Shoot(PROJTYPE _type) { if (UIProjecile == null) { Debug.LogError("UIProjectile is null", this); return; } UIProjectile projectile = Instantiate(UIProjecile, UIController.instance.canvas.transform).GetComponent <UIProjectile>(); projectile.Init(rectTransform.position, direction, _type, 0.1f); }
public void ShootInUI(CARDINAL _dir, PROJTYPE _type) { for (int i = 0; i < uiObjects.Count; i++) { UIShooter uiShooter = uiObjects[i] as UIShooter; if (uiShooter != null && uiShooter.direction == _dir) { uiShooter.Shoot(_type); } } }