Beispiel #1
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);
        }
        //--------------------------------------------------------------------------------------------------------------

        #region Unitycallbacks

        protected override void Awake()
        {
            base.Awake();
            CardHandSelector = transform.parent.GetComponentInChildren <UiCardHandSelector>();
            CardHandSelector.OnCardPlayed += AddCard;
        }