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; }
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; } }
public void Initialize(Game mmoGame, Item botItem, string name, Radar worldRadar, bool isMother) { this.item = botItem; this.name = name; this.isMother = isMother; transform.position = new Vector3(this.item.Position.X, transform.position.y, this.item.Position.Y) * RunBehaviour.WorldToUnityFactor; timeBetweenUpdates = .05f; currHealth = maxHealth; nbuffer = new NStateBuffer(pbuffsize); healthBar = GetComponentInChildren <SimpleHealthBar>(); if (isMother) { guiCanvas = GameObject.FindGameObjectWithTag("gui").GetComponentInChildren <Canvas>(); healthBar.transform.parent = guiCanvas.transform; } }