private void Awake()
 {
     heatModel  = ServiceLocator.instance.Model.GetComponent <Model_Heat>();
     playModel  = ServiceLocator.instance.Model.GetComponent <Model_Play>();
     inputModel = ServiceLocator.instance.Model.GetComponent <Model_Input>();
     gameModel  = ServiceLocator.instance.Model.GetComponent <Model_Game>();
 }
    public void Restart(Vector3 starting, Vector3 pointing)
    {
        if (assetManager == null)
        {
            assetManager = ServiceLocator.instance.Controller.GetComponent <Manager_GameAssets>();
        }
        if (gameModel == null)
        {
            gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();
        }
        if (playModel == null)
        {
            playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();
        }
        if (rocketChild == null)
        {
            rocketChild = transform.GetChild(0);
        }

        transform.position        = starting;
        transform.rotation        = Quaternion.LookRotation(pointing);
        rocketChild.localPosition = Vector3.zero;
        rocketChild.localRotation = Quaternion.identity;

        AcquireTarget();
    }
    private void Awake()
    {
        gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();
        playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();

        quarterLife = gameModel.t_Rockets_ExplosionBallLifetime * .25f;
    }
    // Start is called before the first frame update
    void Start()
    {
        playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();
        gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();
        target    = ServiceLocator.instance.Player;

        rb = GetComponent <Rigidbody>();
    }
Beispiel #5
0
    void Start()
    {
        playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();
        gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();

        SCG_EventManager.instance.Register <Event_PlayerShieldBlock>(EventHandler);
        SCG_EventManager.instance.Register <Event_EnemyBulletHit>(EventHandler);
    }
    void Awake()
    {
        gameModel  = ServiceLocator.instance.Model.GetComponent <Model_Game>();
        heatModel  = ServiceLocator.instance.Model.GetComponent <Model_Heat>();
        inputModel = ServiceLocator.instance.Model.GetComponent <Model_Input>();
        playModel  = ServiceLocator.instance.Model.GetComponent <Model_Play>();
        player     = ServiceLocator.instance.Player;

        assetManager = ServiceLocator.instance.Controller.GetComponent <Manager_GameAssets>();
    }
    void Awake()
    {
        gameModel  = ServiceLocator.instance.Model.GetComponent <Model_Game>();
        heatModel  = ServiceLocator.instance.Model.GetComponent <Model_Heat>();
        inputModel = ServiceLocator.instance.Model.GetComponent <Model_Input>();
        playModel  = ServiceLocator.instance.Model.GetComponent <Model_Play>();

        assetManager = ServiceLocator.instance.Controller.GetComponent <Manager_GameAssets>();

        shieldLinesRenderer = ServiceLocator.instance.Player.Find("ShipParent").Find("PlayerShip").Find("ShieldEdges").GetComponent <MeshRenderer>();
    }
Beispiel #8
0
 void Awake()
 {
     gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();
     SCG_EventManager.instance.Register <Event_PlayerBulletHit>(EffectsEventHandler);
     SCG_EventManager.instance.Register <Event_PlayerRocketHit>(EffectsEventHandler);
     SCG_EventManager.instance.Register <Event_LanceHit>(EffectsEventHandler);
     SCG_EventManager.instance.Register <Event_ExplosionBallHit>(EffectsEventHandler);
     SCG_EventManager.instance.Register <Event_EnemyDeath>(EffectsEventHandler);
     SCG_EventManager.instance.Register <Event_EnemyMineHit>(EffectsEventHandler);
     SCG_EventManager.instance.Register <Event_EnemyMissileHit>(EffectsEventHandler);
 }
    void Start()
    {
        heatModel = ServiceLocator.instance.Model.GetComponent <Model_Heat>();
        playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();
        gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();

        playModel.jumpTotal = 15;


        priority = 8;
        Schedule(this);
    }
    void Start()
    {
        playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();
        gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();

        player = ServiceLocator.instance.Player;

        pos_Initial   = holoPlay.position;
        euler_Initial = holoPlay.eulerAngles;

        SCG_EventManager.instance.Register <Event_EnemyBulletHit>(EventHandler);
    }
Beispiel #11
0
    //private float thrusterVolume;

    void Awake()
    {
        gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();
        //energyModel = ServiceLocator.instance.Model.GetComponent<Model_Energy>();
        inputModel = ServiceLocator.instance.Model.GetComponent <Model_Input>();
        playModel  = ServiceLocator.instance.Model.GetComponent <Model_Play>();
        heatModel  = ServiceLocator.instance.Model.GetComponent <Model_Heat>();
        player     = ServiceLocator.instance.Player;

        dashParts = player.Find("Reticles").Find("ThrusterReticle_Swivel").Find("Dash Particle System").GetComponent <ParticleSystem>();
        dashRet   = player.Find("Reticles").Find("ThrusterReticle_Swivel").Find("ThrusterReticles").Find("DashReticle").GetComponent <MeshRenderer>();
        flyRet    = player.Find("Reticles").Find("ThrusterReticle_Swivel").Find("ThrusterReticles").Find("FlyReticle").GetComponent <MeshRenderer>();
    }
Beispiel #12
0
    void Start()
    {
        delZ = maxZ - minZ;

        clouds = new List <Transform>();
        for (int i = 0; i < max; i++)
        {
            clouds.Add(Instantiate(cloudPrefab, new Vector3(Random.Range(-190, 190), Random.Range(-150f, -60f), Random.Range(minZ, maxZ)), Quaternion.Euler(-90, 0, Random.Range(-180, 180)), transform).transform);
            clouds[i].localScale = Vector3.one * Random.Range(5.00f, 10.00f);
        }

        gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();
        playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();
    }
Beispiel #13
0
    void Start()
    {
        heatModel = ServiceLocator.instance.Model.GetComponent <Model_Heat>();
        playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();
        gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();

        InitializeAssets();

        SCG_EventManager.instance.Register <Event_EnemyBulletHit>(EventHandler);
        SCG_EventManager.instance.Register <Event_LifeUpTick>(EventHandler);

        jPBImage = jumpProgressBar.GetComponent <Image>();
        cSImage  = chargeSpinner.GetComponent <Image>();
    }
Beispiel #14
0
    void Awake()
    {
        gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();

        SCG_EventManager.instance.Register <Event_PlayerBulletHit>(EventHandler);
        SCG_EventManager.instance.Register <Event_LanceHit>(EventHandler);
        SCG_EventManager.instance.Register <Event_ExplosionBallHit>(EventHandler);
        SCG_EventManager.instance.Register <Event_PlayerRocketHit>(EventHandler);
        this.tag = "Enemy";
        if (GetComponent <Rigidbody>() == null)
        {
            Rigidbody r = gameObject.AddComponent <Rigidbody>();
            r.isKinematic = true;
            r.useGravity  = false;
        }
    }
Beispiel #15
0
    void Start()
    {
        assets     = ServiceLocator.instance.Controller.GetComponent <Manager_GameAssets>();
        playModel  = ServiceLocator.instance.Model.GetComponent <Model_Play>();
        gameModel  = ServiceLocator.instance.Model.GetComponent <Model_Game>();
        heatModel  = ServiceLocator.instance.Model.GetComponent <Model_Heat>();
        gameAssets = ServiceLocator.instance.Controller.GetComponent <Manager_GameAssets>();

        _MakeAndRefAudioSources();
        _SetClipsToAudioSources();

        SCG_EventManager.instance.Register <Event_PlayerShieldBlock>(EventHandler);
        SCG_EventManager.instance.Register <Event_EnemyBulletHit>(EventHandler);
        SCG_EventManager.instance.Register <Event_PlayerExplode>(EventHandler);
        SCG_EventManager.instance.Register <Event_LanceHit>(EventHandler);
    }
Beispiel #16
0
        public void Start(int size)
        {
            Type type = typeof(Model_Game);                                             //еее рефлексия типов

            PropertyInfo[] properties = type.GetProperties();
            ListOfModelProperties = properties.Select(prop => prop.Name).ToList();

            if (game != null)
            {
                game.PropertyChanged -= Model_PropertyChanged;
            }
            game = new Model_Game(size);
            game.PropertyChanged += Model_PropertyChanged;

            FillMap();
        }
    void Start()
    {
        gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();
        playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();

        GameObject g = new GameObject("AudioChild");

        left  = g.AddComponent <AudioSource>();
        right = g.AddComponent <AudioSource>();
        both  = g.AddComponent <AudioSource>();

        left.panStereo  = -.65f;
        right.panStereo = .65f;

        left.loop        = right.loop = both.loop = false;
        left.playOnAwake = right.playOnAwake = both.playOnAwake = false;

        SCG_EventManager.instance.Register <Event_Audio>(EventHandler);
    }
Beispiel #18
0
    void Start()
    {
        playModel  = ServiceLocator.instance.Model.GetComponent <Model_Play>();
        inputModel = ServiceLocator.instance.Model.GetComponent <Model_Input>();
        gameModel  = ServiceLocator.instance.Model.GetComponent <Model_Game>();

        player = ServiceLocator.instance.Player;

        priority = 10;
        Schedule(this);

        playModel.lives = 3;
        gameOver.SetActive(false);

        _fsm = new SCG_FSM <Controller_GameState>(this);
        _fsm.TransitionTo <Starting>();

        charge1.Stop();
        charge2.Stop();
        jump1.Stop();
        jump2.Stop();
    }
Beispiel #19
0
 private void Start()
 {
     playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();
     gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();
 }
Beispiel #20
0
 void Awake()
 {
     gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();
     assets    = ServiceLocator.instance.Controller.GetComponent <Manager_GameAssets>();
 }
    protected Vector3 _o = Vector3.right; // for offset;

    protected virtual void GrabStdRefs()
    {
        gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();
        playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();
        _o        = Vector3.zero;
    }
 void Start()
 {
     rends     = shipModel.GetComponentsInChildren <Renderer>();
     playModel = ServiceLocator.instance.Model.GetComponent <Model_Play>();
     gameModel = ServiceLocator.instance.Model.GetComponent <Model_Game>();
 }