SetNativeSize() 공개 메소드

Adjusts the raw image size to make it pixel-perfect.

public SetNativeSize ( ) : void
리턴 void
예제 #1
0
    void Start()
    {
        if (TextureList.Count > Index)
        {
            Image.texture = TextureList[Index];
            Image.SetNativeSize();
            Index += 1;
        }

        Countdown.SetActive(true);
        Interface.SetActive(false);
        Cessation.SetActive(false);
    }
예제 #2
0
 static int SetNativeSize(IntPtr L)
 {
     L.ChkArgsCount(1);
     UnityEngine.UI.RawImage obj = (UnityEngine.UI.RawImage)L.ChkUnityObjectSelf(1, "UnityEngine.UI.RawImage");
     obj.SetNativeSize();
     return(0);
 }
 static public int SetNativeSize(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.UI.RawImage self = (UnityEngine.UI.RawImage)checkSelf(l);
         self.SetNativeSize();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
	static public int SetNativeSize(IntPtr l) {
		try {
			UnityEngine.UI.RawImage self=(UnityEngine.UI.RawImage)checkSelf(l);
			self.SetNativeSize();
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
예제 #5
0
 static public int SetNativeSize(IntPtr l)
 {
     try{
         UnityEngine.UI.RawImage self = (UnityEngine.UI.RawImage)checkSelf(l);
         self.SetNativeSize();
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
    private void _SetSize(UnityEngine.UI.RawImage displayImage)
    {
        if (m_BoundingType == BoundingType.SetNativeSize)
        {
            displayImage.SetNativeSize();
        }
        else
        {
            displayImage.rectTransform.sizeDelta = _CalculateSize(new Vector2(displayImage.texture.width, displayImage.texture.height));
        }

        _ApplyScaleFactor(displayImage.transform);
    }
예제 #7
0
 static int QPYX_SetNativeSize_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 1);
         UnityEngine.UI.RawImage QPYX_obj_YXQP = (UnityEngine.UI.RawImage)ToLua.CheckObject <UnityEngine.UI.RawImage>(L_YXQP, 1);
         QPYX_obj_YXQP.SetNativeSize();
         return(0);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
예제 #8
0
 static int SetNativeSize(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.UI.RawImage obj = (UnityEngine.UI.RawImage)ToLua.CheckObject(L, 1, typeof(UnityEngine.UI.RawImage));
         obj.SetNativeSize();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #9
0
    // Use this for initialization
    void Awake()
    {
        //Connect player score UI
        Brain.OnPlayerScoreChanged(0).Subscribe(e => playerScore[e.playerID].SetScore(e.currentScore)).AddTo(this);
        Brain.OnPlayerScoreChanged(1).Subscribe(e => playerScore[e.playerID].SetScore(e.currentScore)).AddTo(this);
        Brain.OnPlayerScoreChanged(2).Subscribe(e => playerScore[e.playerID].SetScore(e.currentScore)).AddTo(this);
        Brain.OnPlayerScoreChanged(3).Subscribe(e => playerScore[e.playerID].SetScore(e.currentScore)).AddTo(this);
        //Activate correct playerscore UI
        Brain.OnCurrentPlayerChanged().Subscribe(e => {
            foreach (UIPlayerScore s in playerScore)
            {
                s.Show(false);
            }
            playerScore[e].Show(true);
        }).AddTo(this);

        //Setup videoplayer
        VideoPlayer = new UnityVideoPlayer();
        videoPlayerObject.SetActive(false);
        VideoPlayer.OnVideoStarted().Subscribe(e => {
            videoPlayerObject.SetActive(true);
            videoPlayerOutput.texture = e.texture;
            videoPlayerOutput.SetNativeSize();
        }).AddTo(this);
        VideoPlayer.OnVideoFinished().Subscribe(e => {
            videoPlayerObject.SetActive(false);
        }).AddTo(this);

        //Brain.NextPlayer();


        //Setup videomode games
        this.asteroidGame = GameObject.Instantiate(Resources.Load <GameObject>("WC2/Prefabs/Videomode/AsteroidGame"), videoModeGameContainer).GetComponent <IVideomodeGame>();
        this.asteroidGame.SetUnityBridge(this);
        this.asteroidGame.OnGameFinished().Subscribe(e => VideoPlayer.Play(Videos.WC2.Flyby)).AddTo(this);
        //this.asteroidGame.StartGame();
        //Start videomode once brain fires event
        this.Brain.OnBrainEvent <GameBrain.Event_StartVideoMode>().Subscribe(e => {
            this.asteroidGame.StartGame();
        }).AddTo(this);


        //Setup debug unity target visuals
        Brain.lowerLeftDropTargetbank.OnUniqueTargetHit(GameBrain.Switches.DROPTARGETBANK_LOWERLEFT_1).Subscribe(e => debugStuff.targets[0].color = new Color(1, 1, 1, 1)).AddTo(this);
        Brain.lowerLeftDropTargetbank.OnUniqueTargetHit(GameBrain.Switches.DROPTARGETBANK_LOWERLEFT_2).Subscribe(e => debugStuff.targets[1].color = new Color(1, 1, 1, 1)).AddTo(this);
        Brain.lowerLeftDropTargetbank.OnUniqueTargetHit(GameBrain.Switches.DROPTARGETBANK_LOWERLEFT_3).Subscribe(e => debugStuff.targets[2].color = new Color(1, 1, 1, 1)).AddTo(this);
        Brain.lowerLeftDropTargetbank.OnUniqueTargetHit(GameBrain.Switches.DROPTARGETBANK_LOWERLEFT_4).Subscribe(e => debugStuff.targets[3].color = new Color(1, 1, 1, 1)).AddTo(this);
        Brain.lowerLeftDropTargetbank.OnUniqueTargetHit(GameBrain.Switches.TARGETBANK_LOWERLEFT_1).Subscribe(e => debugStuff.targets[4].color     = new Color(1, 1, 1, 1)).AddTo(this);
        Brain.lowerLeftDropTargetbank.OnUniqueTargetHit(GameBrain.Switches.TARGETBANK_LOWERLEFT_2).Subscribe(e => debugStuff.targets[5].color     = new Color(1, 1, 1, 1)).AddTo(this);
        Brain.lowerLeftDropTargetbank.OnUniqueTargetHit(GameBrain.Switches.TARGETBANK_LOWERLEFT_3).Subscribe(e => debugStuff.targets[6].color     = new Color(1, 1, 1, 1)).AddTo(this);
        Brain.lowerLeftDropTargetbank.OnReset().Subscribe(e => {
            for (int i = 0; i < debugStuff.targets.Count; i++)
            {
                Image img = debugStuff.targets[i];
                img.color = new Color(1, 1, 1, 0.2f);
            }
        }).AddTo(this);

        //Start the game
        Brain.StartNewGame();
    }