Exemplo n.º 1
0
        public override void OnInit()
        {
            objectFeature   = Entity.GetFeature <ObjectFeature>();
            playerTransform = objectFeature.GetComponent <PlayerTransform>();

            RegisterUpdate(OnUpdate);
            RegisterFixedUpdate(OnFixedUpdate);
            // 初始化Last
            lastPosition = objectFeature.transform.position;
            lastRotation = objectFeature.transform.rotation;
        }
Exemplo n.º 2
0
        public override void OnInit()
        {
            objectFeature  = Entity.GetFeature <ObjectFeature>();
            swordCollision = objectFeature.GetComponent <SwordCollision>();

            RegisterMessage(MessageID.PlayerAttack, (IBody body) => {
                if (debug)
                {
                    Debug.Log("message start attack");
                }
                AttackStart(body as UintBody);
            });
        }