// Use this for initialization void Start() { // Local setup stuff if (!isLocalPlayer) { return; } FindReferences(); multManager = GameObject.FindGameObjectWithTag("MultiplayerManager").GetComponent <Multiplayer_Manager>(); team = GetCurTeam(); CmdSpawnMyFlagship(team); CmdIncrementCurTeam(); gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Manager_Game>(); gameRules = gameManager.GameRules; // Grab copy of Game Rules SetCommander(gameManager.GetCommander(team)); gameManager.SetController(this); selection = new List <Entity>(); Select(null, false); audioSource = GetComponent <AudioSource>(); lineMouse.SetEffectActive(0); lineVert.SetEffectActive(0); SetMarqueeActive(false); commandWheel.SetController(this); SetCommandWheelActive(false); }
// Use this for initialization public void Init(Unit parent) { hGoals = new List <Vector3>(); gameRules = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Manager_Game>().GameRules; // Grab copy of Game Rules parentUnit = parent; transform = parentUnit.transform; if (audioLoopPrefab) { audioLoop = Object.Instantiate(audioLoopPrefab, transform.position, Quaternion.identity); audioLoop.transform.parent = transform; audioLoop.SetEffectActive(true); } reachedHGoal = true; reachedVGoal = true; hGoalCur = transform.position; // Path towards current location (i.e. nowhere) vGoalCur = Mathf.RoundToInt(transform.position.y); curRSRatio = 0; multManager = GameObject.FindGameObjectWithTag("MultiplayerManager").GetComponent <Multiplayer_Manager>(); // Grab copy of Game Rules ourId = parentUnit.GetComponent <NetworkIdentity>(); }
void Awake() { gameRules = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Manager_Game>().GameRules; warpingAmount = warpModel.transform.localScale.z; warpModel.SetActive(false); multManager = GameObject.FindGameObjectWithTag("MultiplayerManager").GetComponent <Multiplayer_Manager>(); }
//private NetworkIdentity ourId; // Use this for initialization protected void Awake() { gameRules = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Manager_Game>().GameRules; // Grab copy of Game Rules audioSource = GetComponent <AudioSource>(); curAmmo = maxAmmo; shootCooldown = 1f / (rateOfFire / 60f); shootOffset = shootCooldown * shootOffsetRatio; rotation = Quaternion.LookRotation(transform.forward, Vector3.up); multManager = GameObject.FindGameObjectWithTag("MultiplayerManager").GetComponent <Multiplayer_Manager>(); // For multiplayer if (multManager == null) { Debug.LogError("no multmanager found"); } }