コード例 #1
0
        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>();
        }
コード例 #2
0
 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>();
 }
コード例 #3
0
ファイル: EnemyShooter.cs プロジェクト: Juutis/FGJ20
 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");
 }