示例#1
0
 void Awake()
 {
     gm = Camera.main.GetComponent<GameManagement>();
     laneChanging = false;
     laneHeight = gm.GetLaneHeight();
     MoveOffset();
 }
示例#2
0
 // Use this for initialization
 void Start()
 {
     mainCamera = Camera.main;
     inputer = GameObject.FindWithTag ("INPUTER").GetComponent<XInput>();
     gameManager = GameObject.FindWithTag("GameController").GetComponent<GameManagement>();
     statsManager = gameObject.GetComponent<Stats> ();
 }
 void Start()
 {
     ps = GetComponent<ParticleSystem>();
     audioSource = (AudioSource)GameObject.FindWithTag("GameManager").GetComponent(typeof(AudioSource)); ;
     parentStats = GetComponent<Stats> ();
     gm = (GameManagement)GameObject.FindWithTag("GameManager").GetComponent(typeof(GameManagement));
 }
示例#4
0
 // Use this for initialization
 void Start()
 {
     mgmt = Camera.main.GetComponent<GameManagement>();
     bottombound = 0;
     topbound = mgmt.sHeight;
     toplane = topbound - mgmt.laneHeight/2;
     bottomlane = bottombound + mgmt.laneHeight/2;
 }
示例#5
0
 // Use this for initialization
 void Start()
 {
     degatAttente = 0;
     LongueurBarreSanteMAX = Screen.width/6;
     PVMAX = 1000;
     PV = 1000;
     gameManager = GameObject.FindWithTag("GameController").GetComponent<GameManagement>();
 }
示例#6
0
 void Awake() {
     if (instance == null) {
         DontDestroyOnLoad(transform.gameObject);
         instance = this;
     } else if (instance != this) {
         Destroy(gameObject);
     }
 }
示例#7
0
    void Start()
    {
        gameManager = (GameManagement)GameObject.FindWithTag("GameManager").GetComponent(typeof(GameManagement));
        audio = (AudioSource)GameObject.FindWithTag("GameManager").GetComponent(typeof(AudioSource));

        bulletLayer = gameObject.layer;
        //		SetStartingAmmo ();
    }
 void Start()
 {
     mgmt = Camera.main.GetComponent<GameManagement>();
     Scale();
     rightBound = Camera.main.ScreenToWorldPoint( new Vector3(0, Camera.main.GetScreenWidth(), 0) ).x;
     leftBound = -rightBound;
     screenWidth = 2.0f*rightBound;
 }
示例#9
0
 //death function
 public void Die(GameManagement mgmt)
 {
     //Boom!
     //		GameObject d = Instantiate(explosion, transform.position, transform.rotation) as GameObject;
     //goodbye
     Debug.Log("ship is out of healths.  Calling mgmt.PlayerDead()");
     //Hello, management? Yes, the player's dead. He won't be a problem anymore.
     mgmt.PlayerDead(shipNo);
 }
示例#10
0
 protected override bool CheckActvationEvent(GameTime gameTime, Rectangle playerBoundingBox, int timeLeft, Level.Quadtree quadtree, GameManagement.Gamestates.SGame stateGame)
 {
     if (!enabled)
     {
         enabled = true;
         return true;
     }
     else
         return enabled;
 }
    public void Start()
    {
        //Source the management
        mgmt = Camera.main.GetComponent<GameManagement>();

        max_y = Camera.main.orthographicSize;
        min_y = - max_y;

        max_x = (max_y) * Camera.main.aspect;
        min_x = -max_x;
    }
示例#12
0
 protected override DrawPosition InitializeEvent(IServiceProvider serviceProvider, GraphicsDevice device, Level.LevelVariables levelVariables, GameManagement.Options options)
 {
     elapsedTime = timeThreshold;
     grayScale = new GrayScale();
     grayScale.Initialize(serviceProvider, device, options);
     grayScale.StartResetEffect();
     grayScale.BFactor = 0.5f;
     grayScale.RFactor = 0.5f;
     grayScale.GFactor = 0.5f;
     return GameEvents.DrawPosition.Post;
 }
示例#13
0
 // Use this for initialization
 void Start()
 {
     mgmt = Camera.main.GetComponent<GameManagement>();
     cShip = mgmt.ships[0].GetComponent<Ship>();
     mShip = mgmt.ships[1].GetComponent<Ship>();
     yShip = mgmt.ships[2].GetComponent<Ship>();
     cHealth = cShip.GetHealth();
     mHealth = mShip.GetHealth();
     yHealth = yShip.GetHealth();
     maxHealth = 7;
 }
示例#14
0
 void Start()
 {
     //GM
     mgmt = Camera.main.GetComponent<GameManagement>();
     width = mgmt.GetScreenWidth();
     //okay
     x = (transform.position.x+(width/3));
     //On startup, immediately shift forward so the edge will be on the ship, rather than the laser being half forward and half backwards.
     //transform.Translate(new Vector3(-x-x/5, 0, 0));
     transform.Translate ((gameObject.collider as CapsuleCollider).height/2*transform.localScale.y*Vector3.right);
     transform.Rotate(90,90,0);
     //		Debug.Log("Current position" + transform.position);
 }
示例#15
0
 // Use this for initialization
 void Start()
 {
     h=new Vector3[0];
     dmg=new int[0];
     drawdmg = false;
     //arme1 = GameObject.FindWithTag("Arme");
     //arme2 = GameObject.FindWithTag("Arme");
     allonge = 1.0F;
     arme = 0;
     temps = 0.0F;
     temps2 = 0.0F;
     dd=GetComponent<DetectScript>();
     gameManager = GameObject.FindWithTag("GameController").GetComponent<GameManagement>();
 }
示例#16
0
    //int l =100;
    //int h = 20;
    // Use this for initialization
    void Start()
    {
        mgmt = GetComponent<GameManagement>();
        ship1 = mgmt.GetShip(1);
        ship2 = mgmt.GetShip(2);
        ship3 = mgmt.GetShip(3);
        ship1Script = ship1.GetComponent<Ship>();
        ship2Script = ship2.GetComponent<Ship>();
        ship3Script = ship3.GetComponent<Ship>();

        cur1Health = ship1Script.GetHealth();
        cur2Health = ship2Script.GetHealth();
        cur3Health = ship3Script.GetHealth();
        maxHealth = 6;
    }
示例#17
0
 void Awake()
 {
     if(privateGameManagerInstance == null)
     {
         //Wenn es sich um die erste Instanz handelt,
         // wird es zum Singleton ernannt
         transform.parent = null;
         privateGameManagerInstance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         //Wenn es schon ein Singleton gibt, aber ein weiteres
         // Objekt gefunden wird, wird dieses gelöscht
         if(this != privateGameManagerInstance)
         {
             Destroy(this.gameObject);
         }
     }
 }
示例#18
0
 public void GraphicsChanged(GraphicsDevice device, GameManagement.Options options)
 {
     int tempSize = size;
     switch (options.QualitySettings[GameManagement.OptionsID.ShaderQuality])
     {
         case GameManagement.QualitySetting.High:
             tempSize = 32;
             break;
         case GameManagement.QualitySetting.Middle:
             tempSize = 16;
             break;
         case GameManagement.QualitySetting.Low:
             tempSize = 8;
             break;
     }
     if (tempSize != size)
     {
         size = tempSize;
         CreateLUT(device);
     }
 }
示例#19
0
    // Use this for initialization
    void Start()
    {
        gameManager = GameObject.FindWithTag("GameController").GetComponent<GameManagement>();
        // Commande 360
        inputer = GameObject.FindWithTag ("INPUTER").GetComponent<XInput>();
        //Recuperation objet
        //Cam
        //Main_cam = GameObject.FindWithTag ("MainCamera");
        Main_cam = GameObject.FindWithTag ("Player");

        //Capsule
        Competence = GameObject.FindWithTag ("Caps - Competence");
        Forge = GameObject.FindWithTag ("Caps - Forge");
        Entraineur = GameObject.FindWithTag ("Caps - Entraineur");
        Personnage = GameObject.FindWithTag ("Caps - Personnage");

        //Menu
        m_Competence = GameObject.FindWithTag ("Menu - Competence");
        m_Forge = GameObject.FindWithTag ("Menu - Forge");
        m_Entraineur = GameObject.FindWithTag ("Menu - Entraineur");
        m_Personnage = GameObject.FindWithTag ("Menu - Personnage");
    }
示例#20
0
	// -----------------     ----------------     ----------------     ----------------    ----------------     ----------------      // 
	// Defines All Necessiary Attributes And Qualities On Enable
	void OnEnable () 
	{
	
	// ----------  ----------    ----------   ---------- //
	// Checks Whether 'Illustration' Is Attributed To A GameObject
	if (!illustration)
	Debug.Log ("You May Wish To Give The 'Hinterland' Code A Suitable GameObject");
	
	// ----------  ----------    ----------   ---------- //
	// Attributes A Suitable RectTransform To 'Dimension' - Plus Other Such Shenanagins
	dimension  = illustration.GetComponent <RectTransform> ();
	position   = dimension.sizeDelta;
	
	// ----------  ----------    ----------   ---------- //
	// Defines The Game Management Connection
	management = GameObject.FindGameObjectWithTag ("Management").GetComponent <GameManagement> ();
	
	// ----------  ----------    ----------   ---------- //
	// Sets The Basic Width Of The Suitable 'RectTransform"
	dimension.sizeDelta = new Vector2 (0.00f, dimension.sizeDelta.y);
	
	}
示例#21
0
        protected override AvailableEffects InitializeEffect(GraphicsDevice device, GameManagement.Options options)
        {
            GraphicsManager.AddItem(this);

            this.device = device;
            fxData = LayerFXData.Default;

            switch (options.QualitySettings[GameManagement.OptionsID.ShaderQuality])
            {
                case GameManagement.QualitySetting.High:
                    size = 32;
                    break;
                case GameManagement.QualitySetting.Middle:
                    size = 16;
                    break;
                case GameManagement.QualitySetting.Low:
                    size = 8;
                    break;
            }
            CreateLUT(device);
            return AvailableEffects.ColorizeLUT;
        }
示例#22
0
	public void ChangeParts(GameManagement.PlayerColor color)
	{
		if (color == GameManagement.PlayerColor.Red)
		{
			for (int i = 0; i < 8; i++)
			{
				partSelection[i].GetComponent<Image>().sprite = redChassis[i].GetComponent<SpriteRenderer>().sprite;
				partSelection[i].GetComponent<InstantiateObject>().objectToInstantiate = redChassis[i];
			}
		}
		
		if (color == GameManagement.PlayerColor.Yellow)
		{
			for (int i = 0; i < 8; i++)
			{
				partSelection[i].GetComponent<Image>().sprite = yellowChassis[i].GetComponent<SpriteRenderer>().sprite;
				partSelection[i].GetComponent<InstantiateObject>().objectToInstantiate = yellowChassis[i];
			}
		}
		
		if (color == GameManagement.PlayerColor.Green)
		{
			for (int i = 0; i < 8; i++)
			{
				partSelection[i].GetComponent<Image>().sprite = greenChassis[i].GetComponent<SpriteRenderer>().sprite;
				partSelection[i].GetComponent<InstantiateObject>().objectToInstantiate = greenChassis[i];
			}
		}
		
		if (color == GameManagement.PlayerColor.Blue)
		{
			for (int i = 0; i < 8; i++)
			{
				partSelection[i].GetComponent<Image>().sprite = blueChassis[i].GetComponent<SpriteRenderer>().sprite;
				partSelection[i].GetComponent<InstantiateObject>().objectToInstantiate = blueChassis[i];
			}
		}
	}
示例#23
0
    public Laboratory()
    {
        name = "Laboratory";
        shortDescription = "Laboratories let you make researches. They provide points which you can assign to a particular research.";
        longDescription = "Laboratories let you make researches. They provide 1 research point every " + researchPointInterval + " turns, which you can assign to a particular research.";
        flavorText = "Jet fuel can't melt steel beams.";
        foodCost = 0;
        moneyCost = 75;
        buildingMaterialsCost = 150;
        gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent<GameManagement>();

        costs = new Vector3[10];

        costs[0].Set(150, 0, 0);
        costs[1].Set(0, 0, 150);
        costs[2].Set(0, 100, 150);
        costs[3].Set(0, 200, 0);
        costs[4].Set(0, 200, 300);
        costs[5].Set(0, 300, 0);
        costs[6].Set(0, 50, 100);
        costs[7].Set(200, 200, 200);
        costs[8].Set(0, 400, 0);
        costs[9].Set(200, 0, 0);
    }
示例#24
0
 //public int health = 2;
 // Use this for initialization
 void Start()
 {
     //Source the Game Management
     mgmt = Camera.main.GetComponent<GameManagement>();
 }
示例#25
0
    // Use this for initialization
    void Start()
    {
        //sheild animation particle system
        shieldAnim = GetComponent<ParticleSystem>();
        //Source audio
        audioSource = GetComponent<AudioSource>();
        //Source the Game Management
        mgmt = Camera.main.GetComponent<GameManagement>();
        //storing laneheight for future use
        laneHeight = mgmt.GetLaneHeight();

        laneChanging = false;
        laneSplit = false;
    }
示例#26
0
 protected override AvailableEffects InitializeEffect(GraphicsDevice device, GameManagement.Options options)
 {
     PresentationParameters pp = device.PresentationParameters;
     target = new RenderTarget2D(device, pp.BackBufferWidth, pp.BackBufferHeight, false, SurfaceFormat.Color, DepthFormat.None, pp.MultiSampleCount, RenderTargetUsage.PreserveContents);
     return AvailableEffects.ToonShader;
 }
示例#27
0
 void options_DisplayModeChanged(Options options, GameManagement.DisplayMode mode)
 {
     tempDisplayMode = mode;
 }
示例#28
0
    void Awake()
    {
        //Source the Game Management
        mgmt = Camera.main.GetComponent<GameManagement>();

        //Source the Arrow Model
        arrowModel = transform.FindChild("ArrowModel");

        //Source the Explosion
        //explosion = GameObject.FindWithTag("Explosion");
    }
示例#29
0
 // Use this for initialization
 void Start()
 {
     //Source the Game Management
     mgmt = Camera.main.GetComponent<GameManagement>();
     laneHeight = mgmt.laneHeight;
     //get length and width of the board
     sHeight = mgmt.sHeight;
     sWidth = mgmt.sWidth;
 }
示例#30
0
 // Use this for initialization
 void Start()
 {
     health = 6;
     //Source the Game Management
     mgmt = Camera.main.GetComponent<GameManagement>();
     laneHeight = mgmt.laneHeight;
     //get boundaries of the board
     sHeight = mgmt.sHeight;
     sWidth = mgmt.sWidth;
     invincibilityCounter = 0;
 }