void Start() { player1 = GameObject.FindGameObjectWithTag("Player1").transform; player2 = GameObject.FindGameObjectWithTag("Player2").transform; forcefieldController = GetComponent <ArturForcefieldController>(); forcefieldController.Initialize(-1); forcefield = gameObject.transform.Find("ForceField").transform; forcefield.localScale = new Vector3(.0f, .0f, .0f); energy = energyMax; eyes = gameObject.transform.Find("Eyes"); agent = GetComponent <NavMeshAgent>(); agent.autoBraking = false; waypoints = new Vector3[waypointsInitial.Length]; for (int i = 0; i < waypointsInitial.Length; ++i) { waypoints[i] = waypointsInitial[i].transform.position; Destroy(waypointsInitial[i]); } action = Actions.WALK; layerMask = 1 << 14; // 12: PlayerShot ??? -> 14: ReactsToForceField Layer id layerMask = ~layerMask; audioSource = GetComponent <AudioSource>(); }
private void Start() { forcefieldController = transform.GetChild(0).GetComponent <ArturForcefieldController>(); forcefieldController.Initialize(-1); this.controllerType = ArturControllerSettings.player1ControllerType; this.playerNumber = ArturControllerSettings.player1ControllerNumber; // TODO: Remove this later. It's just to test the scenes without going through the main menu. if (ArturControllerSettings.player1ControllerType == string.Empty) { this.controllerType = "Xbox"; } if (ArturControllerSettings.player1ControllerNumber == -1) { this.playerNumber = 1; } base.Initialize(); }