Exemplo n.º 1
0
        //--------------------------------------------------------------------------------------------------------------

        #region Unity Callbacks

        void Awake()
        {
            //components
            MyTransform = transform;
            MyCollider  = GetComponent <Collider>();
            MyRigidbody = GetComponent <Rigidbody>();
            MyInput     = GetComponent <IMouseInput>();
            Hand        = transform.parent.GetComponentInChildren <IUiPlayerHand>();
            MyRenderers = GetComponentsInChildren <SpriteRenderer>();
            MyRenderer  = GetComponent <SpriteRenderer>();

            //transform
            Scale    = new UiMotionScaleCard(this);
            Movement = new UiMotionMovementCard(this);
            Rotation = new UiMotionRotationCard(this);

            //fsm
            Fsm = new UiCardHandFsm(MainCamera, cardConfigsParameters, this);
        }
Exemplo n.º 2
0
        //--------------------------------------------------------------------------------------------------------------

        #region Unity Callbacks

        public void Initialize()
        {
            //components
            MyTransform  = transform;
            MyCollider   = GetComponent <Collider2D>();
            MyRigidbody  = GetComponent <Rigidbody2D>();
            MyInput      = GetComponent <IMouseInput>();
            HandSelector = transform.GetComponentInParent <UiCardHandSelector>();
            MyRenderers  = GetComponentsInChildren <SpriteRenderer>();
            MyRenderer   = GetComponent <SpriteRenderer>();

            //transform
            Scale    = new UiMotionScaleCard(this);
            Movement = new UiMotionMovementCard(this);
            Rotation = new UiMotionRotationCard(this);

            (MyCollider as BoxCollider2D).size = cardConfigsParameters.CardSize.Value;
            //fsm
            Fsm = new UiCardHandFsm(MainCamera, CardConfigsParameters, this);
        }