public static UIStateSprite create(UIToolkit manager, string filename, int xPos, int yPos, int depth) { var filenames = new string[1] { filename }; return(UIStateSprite.create(manager, filenames, xPos, yPos, depth)); }
public static UIStateSprite create(UIToolkit manager, string[] filenames, int xPos, int yPos, int depth) { // Grab the texture details for the initial state UITextureInfo firstNormalTI = manager.textureInfoForFilename(filenames[0]); Rect frame = new Rect(xPos, yPos, firstNormalTI.frame.width, firstNormalTI.frame.height); // create the button UIStateSprite sprite = new UIStateSprite(manager, frame, depth, firstNormalTI.uvRect); // Add frames sprite.addFrames(filenames); return sprite; }
public static UIStateSprite create(UIToolkit manager, string[] filenames, int xPos, int yPos, int depth) { // Grab the texture details for the initial state UITextureInfo firstNormalTI = manager.textureInfoForFilename(filenames[0]); Rect frame = new Rect(xPos, yPos, firstNormalTI.frame.width, firstNormalTI.frame.height); // create the button UIStateSprite sprite = new UIStateSprite(manager, frame, depth, firstNormalTI.uvRect); // Add frames sprite.addFrames(filenames); return(sprite); }
// Use this for initialization void Start() { stage = GameObject.Find( "Floor").GetComponent<Stage>(); GameObject objUser = GameObject.Find( "User"); statusUser = objUser.GetComponent<StatusUser>(); motionUser = objUser.GetComponent<MotionUser>(); attackUser = objUser.GetComponent<AttackUser>(); motionCamera = Camera.mainCamera.GetComponent<MotionCamera>(); // Se calcula la relación entre la resolución virtual de referencia y la resolución actual de pantalla fRatioX = Screen.width * 1.0f / iWidthScreen; fRatioY = Screen.height * 1.0f / iHeightScreen; // Se crea la barra de energía y se inicializan los parámetros relacionados. barUserEnergy = UIStateSprite.create( "Energy.png", 0, 0); barUserEnergy.hidden = false; barGunEnergy = UIStateSprite.create( "Level.png", 0, 0); barGunEnergy.hidden = false; textKilled = new UIText( "prototype", "prototype.png"); textEnemies = new UIText( "prototype", "prototype.png"); textRecord = new UIText( "prototype", "prototype.png"); textEnemiesInstance = textEnemies.addTextInstance( "Enemigos: 0", iXTextEnemies * fRatioX, iYTextEnemies * fRatioY, 0.8f, 1, Color.green); textKilledInstance = textKilled.addTextInstance( "Asesinatos: 0", iXTextKilled * fRatioX, iYTextKilled * fRatioY, 0.8f, 1, Color.red); textRecordInstance = textRecord.addTextInstance( "Record: " + PlayerPrefs.GetInt( "Record", 0), iXTextRecord * fRatioX, iYTextRecord * fRatioY, 0.8f, 1, Color.black); buttonPersp = UIButton.create( "emptyUp.png", "emptyDown.png", 0, 0); buttonPersp.hidden = false; textPersp = new UIText( "prototype", "prototype.png"); textPerspInstance = textPersp.addTextInstance( motionCamera.strCameraPersp, iXTextPersp * fRatioX, iYTextPersp * fRatioY, 0.9f, 1, Color.blue); }
// Use this for initialization void Awake() { // Se inicializa el estado del objeto. _iEnergy = iMaxEnergy; _action = Action.normal; _objKiller = _objKamikaze = null; // Se crea la barra de energía y se inicializan los parámetros relacionados. barEnergy = UIStateSprite.create( "Energy.png", 0, 0); barEnergy.zIndex = 1; bShowEnergy = false; bNewShowEnergy = true; fTimeShowEnergy = 0; barEnergy.hidden = true; thisAudioSource = audio; thisGameObject = gameObject; thisTransform = transform; thisRenderer = renderer; motionBot = GetComponent<MotionBot>(); fMagnitude = thisRenderer.bounds.extents.magnitude; // Valor de la extensión del mesh de este enemigo. // Componente Stage del objeto que representa el nivel. stage = GameObject.Find( "Floor").GetComponent<Stage>(); screenInterface = GameObject.Find( "Floor").GetComponent<ScreenInterface>(); }
public static UIStateSprite create(UIToolkit manager, string[] filenames, int xPos, int yPos) { return(UIStateSprite.create(manager, filenames, xPos, yPos, 1)); }
public static UIStateSprite create(string[] filenames, int xPos, int yPos) { return(UIStateSprite.create(UI.firstToolkit, filenames, xPos, yPos)); }