public void Initialize(bool enabled = true) { if (!isInitialized) { GameObject characterPrefab = ResourceHelpers.LoadCharacterPrefab($"Character[{Name}]"); GameObject characterObject = CharacterManager.AddCharacterObject(characterPrefab); RootElement = characterObject.GetComponent <RectTransform>(); Image renderObject = RootElement.transform.Find(renderLayerName).GetComponentInChildren <Image>(); Renderer = new SingleLayerRenderer(new RenderLayer() { CurrentRenderer = renderObject }); MoveTransition = new MoveTransition() { ElementRect = RootElement }; Enabled = enabled; isInitialized = true; } }
public void StopMoving(bool moveToTarget = false) { MoveTransition.StopMoving(moveToTarget); }
public void MoveTo(Vector2 target, float speed, bool smooth = true) { MoveTransition.MoveTo(target, speed, smooth); }