public ShootingSystem(SystemConfig inConfig) : base(inConfig) { if (inConfig != null) { _config = inConfig as ShootingConfig; } _holder = new GameObject("Bullets Holder").transform; _holder.SetParent(GameState.GameHolder); _holder.SetPositionAndRotation(Vector3.zero, Quaternion.identity); _bulletsInScene = new HashSet <GameView>(); }
void Start() { FindCannons(); config = (ShootingConfig)Resources.Load("Configs/ShootingConfig"); if (config == null) { Debug.LogWarning("Couldn't find Resources/Configs/ShootingConfig!"); } if (leftCannon == null || rightCannon == null) { Debug.LogWarning("Couldn't find cannons!"); } rb2d = GetComponent <Rigidbody2D>(); }
void Start() { FindCannons(); config = (ShootingConfig)Resources.Load("Configs/EnemyShootingConfig"); if (config == null) { Debug.LogWarning("Couldn't find Resources/Configs/EnemyShootingConfig!"); } if (leftCannon == null || rightCannon == null) { Debug.LogWarning("Couldn't find cannons!"); } player = GameObject.FindGameObjectWithTag("Player"); }