Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
 public void StopMoving(bool moveToTarget = false)
 {
     MoveTransition.StopMoving(moveToTarget);
 }
Esempio n. 3
0
 public void MoveTo(Vector2 target, float speed, bool smooth = true)
 {
     MoveTransition.MoveTo(target, speed, smooth);
 }