Samstag, 21. März 2020

Unity 3d - change Object Position by script

how to change the position of an unity object?

- add a script to the object
- apply the "transform.position" property of type Vector3


Freitag, 14. Februar 2020

Unity 3d - change color

image - see https://www.youtube.com/watch?v=_RIsfVOqTaE

using UnityEngine.UI;
..
public Image img;
...
img.color = Color.red; //



object - see https://learn.unity.com/tutorial/scripts-as-behaviour-components#

GetComponent<Renderer> ().material.color = Color.red;


Unity 3d - set screen resolution

Screen.SetResulotion(1600,900,false);
where 1600 is the width, 900 the height and finally a boolean to signalize the fullscreen mode.

Dienstag, 11. Februar 2020

Unity 3d - c# Awake and Start methods

see https://www.youtube.com/watch?v=4QdjoV63wjM

Awake() initializes private variables of an object once a startup.

When later on the object is gonna be enabled it will benefit of all settings made in Awake().
This will be unattended handled by Unity when the Start() script is being called.



Unity 3d - wait a few seconds / sleep

C# - How to wait a while in Unity 3d see https://docs.unity3d.com/ScriptReference/WaitForSeconds.html
...
StartCoroutine(TimeRoutine());
...
IEnumerator TimeRoutine()
{
       yield return new WaitForSeconds(3.0f); // wait 3 seconds within this TimeRoutine thread
       //load the next scene then for instance
}



Unity 3d - change scence how to

C#: how to switch to another scene in Unity 3d

using UnityEngine.SceneManagement;
..
SceneManager.LoadScene("myNextScene");

get current scene name:

Debug.Log(SceneManager.GetActiveScene().name.ToString());

get Scene:

private Scene view;
...
this.view = SceneManager.GetActiveScene();

Sonntag, 16. Februar 2014

Packages for dev a MonoGame(XNA) in Xamarin on Windows -> Projecttype ANDROID MonoGame

base = untouched 7/8.x Windows system

a) Inst. XAMARIN STUDIO for Windows :-)
b) download "MonoGame" AddIn for Xamarin on CODEPLEX - Use the ADDIN Manager of XAMARIN to add it...
c) download the Android SDK atd-bundle zip Archive and uncompress it - use the inner SDK MANAGER.exe to install the packages