Beispiel #1
0
	// Use this for initialization
	IEnumerator Start () 
	{
		grid = FindObjectOfType<VectorGrid>();
		yield return new WaitForEndOfFrame();
		InvokeRepeating("LifeTimeFade", MaxLifetime, 1);
		GetComponent<Rigidbody2D>().velocity = transform.TransformDirection(Vector2.up)*Speed;
		GetComponent<Rigidbody2D>().velocity += addV;
	}
Beispiel #2
0
    // Use this for initialization
    IEnumerator Start()
    {
        grid = FindObjectOfType <VectorGrid>();
        yield return(new WaitForEndOfFrame());

        InvokeRepeating("LifeTimeFade", MaxLifetime, 1);
        GetComponent <Rigidbody2D>().velocity  = transform.TransformDirection(Vector2.up) * Speed;
        GetComponent <Rigidbody2D>().velocity += addV;
    }
Beispiel #3
0
    protected virtual void CheckForObjectChanges()
    {
        VectorGrid targetGrid = target as VectorGrid;

        targetGrid.m_GridWidth           = Mathf.Max(1, targetGrid.m_GridWidth);
        targetGrid.m_GridHeight          = Mathf.Max(1, targetGrid.m_GridHeight);
        targetGrid.m_LooseSpringInterval = Mathf.Max(1, targetGrid.m_LooseSpringInterval);
        targetGrid.m_GridSmoothingFactor = Mathf.Max(0, targetGrid.m_GridSmoothingFactor);

        if (m_InitialGridWidth != targetGrid.m_GridWidth ||
            m_InitialGridHeight != targetGrid.m_GridHeight)
        {
            Undo.RecordObject(targetGrid, "Adjusted Vector Grid Dimensions");
            targetGrid.InitGrid();
        }

        if (m_InitialGridScale != targetGrid.m_GridScale)
        {
            Undo.RecordObject(targetGrid, "Adjusted Vector Grid Scale");
            targetGrid.InitGrid();
        }

        if (m_InitialLineSpacingX != targetGrid.m_ThickLineSpacingX ||
            m_InitialLineSpacingY != targetGrid.m_ThickLineSpacingY)
        {
            Undo.RecordObject(targetGrid, "Adjusted Vector Grid Line Spacing");
            targetGrid.InitGrid();
        }

        if (m_InitialThickColor != targetGrid.m_ThickLineSpawnColor ||
            m_InitialThinColor != targetGrid.m_ThinLineSpawnColor)
        {
            Undo.RecordObject(targetGrid, "Adjusted Vector Grid Line Color");
            targetGrid.InitGrid();
        }

        if (m_InitialThickWidth != targetGrid.m_ThickLineWidth ||
            m_InitialThinWidth != targetGrid.m_ThinLineWidth)
        {
            Undo.RecordObject(targetGrid, "Adjusted Vector Grid Line Width");
            targetGrid.InitGrid();
        }

        if (m_InitialGridSmoothing != targetGrid.m_GridSmoothingFactor)
        {
            Undo.RecordObject(targetGrid, "Adjusted Vector Grid Smoothing");
            targetGrid.InitGrid();
        }

        if (m_InitialRenderMode != (int)targetGrid.m_RenderMode)
        {
            Undo.RecordObject(targetGrid, "Changed Vector Grid Render Mode");
            targetGrid.InitGrid();
        }
    }
Beispiel #4
0
    public void Initialize(F3DFXController f3d)
    {
        fxController = f3d;
        firstUpdate  = true;
        nbuffer      = new NStateBuffer(pbuffsize);
        Show(false);

        vectorGrid    = GameObject.FindWithTag("vectorgrid");
        gridComponent = vectorGrid.GetComponentInChildren <VectorGrid>();
        //  velocityEstimate = new Vector2(item.Rotation.X, item.Rotation.Y) * 2f;
    }
Beispiel #5
0
 public void ApplyVectorGridSynchronously(VectorGrid _vectorGrid)
 {
     foreach (var particle in particles)
     {
         var tile = _vectorGrid.Get(_vectorGrid.WorldPositionToGridPosition(particle.Position));
         if (tile != null)
         {
             particle.ApplyForce(0.001f * tile.Vector * Game.Delta);
         }
     }
 }
Beispiel #6
0
	void Update () 
	{
		if(canMove)
		{
			FaceMouse();

			DoRockets();
		}
		if(vGrid != null)
			AddForce();
		else
			vGrid = FindObjectOfType<VectorGrid>();

	}
Beispiel #7
0
    public void Initialize(Game mmoGame, Item actorItem, string name, Radar worldRadar)
    {
        totalGold          = 0;
        isBuildMode        = false;
        isSuperFast        = false;
        this.item          = actorItem;
        this.name          = name;
        transform.position = new Vector3(this.item.Position.X, transform.position.y, this.item.Position.Y) *
                             RunBehaviour.WorldToUnityFactor;
        currHealth = maxHealth;
        healthBar  = GameObject.FindWithTag("hpbar").GetComponent <SimpleHealthBar>();
        UnparentLaserAndStoreRef();
        if (this.item.IsMine)
        {
            playerCam = GameObject.FindWithTag("MainCamera");
            playerCam.GetComponent <CameraController>().playerShip = this.gameObject;
            vectorGrid = GameObject.FindWithTag("vectorgrid");
            //           vectorGrid.transform.position = this.transform.position;
            gridComponent = vectorGrid.GetComponentInChildren <VectorGrid>();
        }
        //        GameObject.FindWithTag("MainCamera").GetComponent<MSCameraController>().playerObject = this.gameObject;

        ShowActor(false);
        lastTime    = 0;
        nbuffer     = new NStateBuffer(pbuffsize);
        hudObj      = GameObject.FindGameObjectWithTag("Hud");
        firstUpdate = true;
        // turn off mesh render for wireball
        MeshRenderer[] mrs = GetComponentsInChildren <MeshRenderer>();
        foreach (var mr in mrs)
        {
            if (mr.gameObject.tag == "wireball")
            {
                wireBall         = mr;
                wireBall.enabled = false;
                Debug.Log("wireball INIT " + wireBall.enabled.ToString());
                break;
            }
        }

        prevMouse      = Input.mousePosition;
        laserbeam      = GetComponentInChildren <F3DPlayerTurretController>();
        beamController = GetComponentInChildren <F3DFXController>();
        if (beamController != null)
        {
            beamController.TurretSocket[0] = this.transform;
        }
    }
Beispiel #8
0
    protected virtual void StoreInitialValues()
    {
        VectorGrid targetGrid = target as VectorGrid;

        m_InitialGridWidth     = targetGrid.m_GridWidth;
        m_InitialGridHeight    = targetGrid.m_GridHeight;
        m_InitialLineSpacingX  = targetGrid.m_ThickLineSpacingX;
        m_InitialLineSpacingY  = targetGrid.m_ThickLineSpacingY;
        m_InitialGridScale     = targetGrid.m_GridScale;
        m_InitialThickColor    = targetGrid.m_ThickLineSpawnColor;
        m_InitialThinColor     = targetGrid.m_ThinLineSpawnColor;
        m_InitialThickWidth    = targetGrid.m_ThickLineWidth;
        m_InitialThinWidth     = targetGrid.m_ThinLineWidth;
        m_InitialGridSmoothing = targetGrid.m_GridSmoothingFactor;
        m_InitialRenderMode    = (int)targetGrid.m_RenderMode;
    }
Beispiel #9
0
    void Update()
    {
        if (canMove)
        {
            FaceMouse();

            DoRockets();
        }
        if (vGrid != null)
        {
            AddForce();
        }
        else
        {
            vGrid = FindObjectOfType <VectorGrid>();
        }
    }
Beispiel #10
0
    //The big middle screen countdown, also resets the round score
    public IEnumerator CountdownStart(int time)
    {
        UIObject = GameObject.FindGameObjectWithTag("inGameUI");

        _players[1].color = PlayerColor.Yellow;
        _players[2].color = PlayerColor.Red;
        _players[3].color = PlayerColor.Blue;
        _players[4].color = PlayerColor.Green;

        _players[1].spawnPoint = GameObject.FindGameObjectWithTag("northSpawnPoint");
        _players[2].spawnPoint = GameObject.FindGameObjectWithTag("eastSpawnPoint");
        _players[3].spawnPoint = GameObject.FindGameObjectWithTag("southSpawnPoint");
        _players[4].spawnPoint = GameObject.FindGameObjectWithTag("westSpawnPoint");

        _players[1].score = _players[2].score = _players[3].score = _players[4].score = 0;

        GameObject[] shipPrefabs = new[] { p1ShipPrefab, p2ShipPrefab, p3ShipPrefab, p4ShipPrefab };

        foreach (Player player in _players.Values)
        {
            if (player.joined)
            {
                GameObject prefab = shipPrefabs[player.playerNumber - 1];
                player.ship = Instantiate(prefab, player.spawnPoint.transform.position, player.spawnPoint.transform.rotation);
                player.ship.GetComponent <ShipController>().heading = player.spawnPoint.transform.rotation.eulerAngles.z * Mathf.Deg2Rad;
                player.gridManager = player.ship.GetComponent <ShipGridManager>();
            }
            else
            {
                player.color = PlayerColor.Dead;
                UIObject.GetComponent <GameUI>().UpdateColor(player.playerNumber, player.color);
            }
        }

        gameGrid = GameObject.FindGameObjectWithTag("VectorGrid").GetComponent <VectorGrid>();

        UIObject.GetComponent <GameUI>().countdown.StartCountdown();
        yield return(new WaitForSeconds(8));

        countDownTextObject.text = "";
        gameState = GameState.CoinGameModeStart;
    }
Beispiel #11
0
	void Start()
	{
		Application.targetFrameRate = 60;
		m_VectorGrid = GameObject.Find("VectorGrid").GetComponent<VectorGrid>();
	}
 void Start()
 {
     m_VectorGrid = GameObject.Find("Aurora").GetComponent <VectorGrid>();
 }
Beispiel #13
0
	// Use this for initialization
	void Start () {
		m_VectorGrid = GameObject.Find("VectorGrid").GetComponent<VectorGrid>();
		playershooter = gameObject.GetComponent<Owner> ().playerowner;
		playershields = playershooter.GetComponent<PlayerShields> ();
		gameObject.particleSystem.startColor = playercolor;
	}
 void Start()
 {
     Application.targetFrameRate = 60;
     m_VectorGrid = GameObject.Find("VectorGrid").GetComponent <VectorGrid>();
 }
Beispiel #15
0
	// Use this for initialization
	void Start () {
		m_VectorGrid = GameObject.Find("VectorGrid").GetComponent<VectorGrid>();
		AssignControls ();
		Fire_Method = "FireInput";

	}
Beispiel #16
0
	// Use this for initialization
	void Start () {
		Destroy (gameObject, 3f);
		m_VectorGrid = GameObject.Find("VectorGrid").GetComponent<VectorGrid>();
		gameObject.particleSystem.startColor = playercolor;
	}
Beispiel #17
0
 void Start()
 {
     grid = FindObjectOfType <VectorGrid>();
 }
Beispiel #18
0
	// Use this for initialization
	void Start () {
		m_VectorGrid = GameObject.Find("VectorGrid").GetComponent<VectorGrid>();
	}
Beispiel #19
0
 public override void Start()
 {
     particleSet = new ParticleSet(100);
     grid        = new VectorGrid(-Width / 2f, -Height / 2f, Width, Height, 20);
 }