// Use this for initialization void Start() { players = GameObject.FindGameObjectsWithTag("PlayerTeam1"); //mon equipe oponents = GameObject.FindGameObjectsWithTag("OponentTeam"); //l'equipe adverse inGame = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <InGameState_Script>(); blobPlayerSelected = GameObject.FindGameObjectWithTag("PlayerSelected").transform; //cercle jaune }
// Use this for initialization void Start() { // get players, joystick, InGame and Blob players = GameObject.FindGameObjectsWithTag("PlayerTeam1"); oponents = GameObject.FindGameObjectsWithTag("OponentTeam"); joystick = GameObject.FindGameObjectWithTag("joystick").GetComponent <Joystick_Script>(); inGame = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <InGameState_Script>(); blobPlayerSelected = GameObject.FindGameObjectWithTag("PlayerSelected").transform; }
// Use this for initialization void Start() { OutPosition = new Vector3(38, 100, 55); //Valor inicial, resetear siempre que se completen los eventos // get players, joystick, InGame and Blob Locals = GameObject.Find("Local").GetComponent <STeam>().Locals; Visitors = GameObject.Find("Visit").GetComponent <STeam>().Visitors; //joystick = GameObject.FindGameObjectWithTag("joystick").GetComponent<Joystick_Script>(); inGame = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <InGameState_Script>(); //blobPlayerSelected = GameObject.FindGameObjectWithTag("PlayerSelected").transform; }
// Start is called before the first frame update void Start() { inGame = FindObjectOfType <InGameState_Script>(); center = GameObject.Find("Center_Field").GetComponent <Transform>(); bFirstHalf = inGame.bFirstHalf; //Inicializacion de variables de comportamiento sbehaviors = new Sbehavior[6]; cbehaviors = new Cbehavior[8]; weights = new Dictionary <string, float>(); pweights = new float[sbehaviors.Length + cbehaviors.Length]; wkeys = new string[sbehaviors.Length + cbehaviors.Length]; ControlStates = new Dictionary <string, bool>(); Ckeys = new List <string>(); //FIXME: esto no tiene sentido ControlTimes = new Dictionary <string, float>(); Tkeys = new List <string>(); //FIXME: esto no tiene sentido //Inicializacion de variables de ambiente sphere = GameObject.Find("soccer_ball").GetComponent <Sphere>(); GoalLocal = GameObject.Find("GoalRight"); GoalVisit = GameObject.Find("GoalLeft"); if (this.transform.parent.name == "Local") { TeamName = "Local"; playerTeam = GameObject.Find("Local").GetComponent <STeam>(); opponentTeam = GameObject.Find("Visit").GetComponent <STeam>(); Opponents = opponentTeam.Visitors; Teammates = playerTeam.Locals; } else { TeamName = "Visit"; playerTeam = GameObject.Find("Visit").GetComponent <STeam>(); opponentTeam = GameObject.Find("Local").GetComponent <STeam>(); Opponents = opponentTeam.Locals; Teammates = playerTeam.Visitors; } Initialize(); playerCollider = GetComponent <Collider>(); GetComponentInChildren <SkinnedMeshRenderer>().material = Resources.Load("Materials/" + "player_texture_" + PlayerPrefs.GetString(transform.parent.name)) as Material; //Animaciones------------------------------------------------------------------------------------------------ GetComponent <Animation>()["jump_backwards_bucle"].speed = 1.5f; GetComponent <Animation>()["starting"].speed = 1.0f; GetComponent <Animation>()["starting_ball"].speed = 1.0f; GetComponent <Animation>()["running"].speed = 1.2f; GetComponent <Animation>()["running_ball"].speed = 1.0f; GetComponent <Animation>()["pass"].speed = 1.8f; GetComponent <Animation>()["rest"].speed = 1.0f; GetComponent <Animation>()["turn"].speed = 2f; GetComponent <Animation>()["tackle"].speed = 4.0f; GetComponent <Animation>()["fight"].speed = 1.2f; // para el movimiento de la cabeza de los jugadores GetComponent <Animation>().Play("rest"); }
// Use this for initialization void Start() { inGame = GameObject.FindObjectOfType(typeof(InGameState_Script)) as InGameState_Script; }