private void Awake() { this.GetComponent <RectTransform>().anchoredPosition3D = Vector3.zero; Poping = this.gameObject.GetComponent <UIScaleAction>(); Hide(); }
public void UIAction_Create() { // Use the Assert class to test conditions. if (Canvas == null) { Canvas = GameObject.Instantiate(Resources.Load <GameObject>("Prefabs/Canvas")); } if (Actor == null) { Actor = GameObject.Instantiate(Resources.Load <GameObject>("Prefabs/Actor")); rtActor = Actor.AddComponent <RectTransform>(); rtActor.SetParent(Canvas.transform); actPosition = Actor.AddComponent <UIPositionAction>(); actScale = Actor.AddComponent <UIScaleAction>(); actRotation = Actor.AddComponent <UIRotateAction>(); actColor = Actor.AddComponent <UIColorAction>(); actText = Actor.AddComponent <UITextAction>(); } }