示例#1
0
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        PreparePool();
    }
示例#2
0
    static Game()
    {
        GameObject game = SafeFind("_app");

        m_players          = (PlayerManager)SafeComponent(game, "PlayerManager");
        m_keybinds         = (KeybindManager)SafeComponent(game, "KeybindManager");
        m_options          = (OptionManager)SafeComponent(game, "OptionManager");
        m_audio            = (AudioManager)SafeComponent(game, "AudioManager");
        m_leaderNetHandler = (LeaderboardNetworkHandler)SafeComponent(game, "LeaderboardNetworkHandler");
        m_projPool         = (ProjectilePooler)SafeComponent(SafeFind("ProjectilePooler"), "ProjectilePooler");
    }
    void Awake()
    {
        direction                = new Vector2(1, 0);
        body                     = GetComponent <Rigidbody2D>();
        lastTimeShot             = Random.Range(0, 1);
        lastTimeDirectionChanged = 0;
        pooler                   = GameObject.Find("Projectile Pooler").transform.Find("Enemies").GetComponent <ProjectilePooler>();

        int currentLevel = PlayerPrefs.GetInt("Space Invaders Level", 1);

        points        = 100 * currentLevel;
        acceleration += 0.05f * currentLevel;
    }
示例#5
0
    static Game()
    {
        GameObject game = SafeFind("_app");

        m_setManager         = (PersistentSetManager)SafeComponent(game, "PersistentSetManager");
        m_options            = (OptionManager)SafeComponent(game, "OptionManager");
        m_languages          = (LanguageManager)SafeComponent(game, "LanguageManager");
        m_audio              = (AudioManager)SafeComponent(game, "AudioManager");
        m_projPool           = (ProjectilePooler)SafeComponent(SafeFind("ProjectilePooler"), "ProjectilePooler");
        m_npcGenerator       = (NPCGenerator)SafeComponent(game, "NPCGenerator");
        m_enemyGenerator     = (EnemyGenerator)SafeComponent(game, "EnemyGenerator");
        m_rewiredEventSystem = (RewiredStandaloneInputModule)SafeComponent(SafeFind("Rewired Event System"), "RewiredStandaloneInputModule");
        m_controlMapper      = (ControlMapper)SafeComponent(SafeFind("ControlMapper"), "ControlMapper");
        m_controlMapperMenu  = (Menu)SafeComponent(SafeFind("Canvas"), "Menu");

        ProjectileBehaviour.LoadAll();
        ShotPattern.LoadAll();
        BaseItem.LoadAll();
        Ability.LoadAll();
        Skill.LoadAll();
        State.LoadAll();

        m_controlMapperMenu.gameObject.SetActive(false);
    }
示例#6
0
 /// <summary>
 /// Initialized projectile. Binds it to a projectile pooler.
 /// </summary>
 /// <param name="pooler">Projectile pooler the projectile should be bound to</param>
 public void Init(ProjectilePooler pooler)
 {
     this.pooler = pooler;
 }
示例#7
0
 private void Awake()
 {
     Instance = this;
 }
示例#8
0
 void Awake()
 {
     k_SharedInstance = this;
 }
示例#9
0
 void Awake()
 {
     Instance = this;
 }
示例#10
0
 private void Awake()
 {
     instance   = this;
     objectPool = new ObjectPool <Projectile>(projectilePrefab, 150, transform);
 }
示例#11
0
 private void Start()
 {
     pool = ProjectilePooler.Instance;
 }