public virtual void Init(IDevicePartManipulation devicePartManipulation, Dictionary <InputDevicePartType, SCPointEventData> eventDataDic, Transform targetTransform, MoveLogic moveLogic, RotateLogic rotateLogic, ScaleLogic scaleLogic)
 {
     this.devicePartManipulation = devicePartManipulation;
 }
Ejemplo n.º 2
0
 public override void Init(IDevicePartManipulation devicePartManipulation, Dictionary <InputDevicePartType, SCPointEventData> eventDataDic, Transform targetTransform, MoveLogic moveLogic, RotateLogic rotateLogic, ScaleLogic scaleLogic)
 {
     base.Init(devicePartManipulation, eventDataDic, targetTransform, moveLogic, rotateLogic, scaleLogic);
     this.devicePartManipulation.OneDevicePartInit(eventDataDic, targetTransform, moveLogic, rotateLogic, scaleLogic);
 }
Ejemplo n.º 3
0
        public override void OnPointerDown(PointerEventData eventData)
        {
            base.OnPointerDown(eventData);

            if (eventDataDic == null)
            {
                eventDataDic = new Dictionary <InputDevicePartType, SCPointEventData>();
            }

            if (scaleLogic == null)
            {
                scaleLogic = new ScaleLogic();
            }

            if (rotateLogic == null)
            {
                rotateLogic = new RotateLogic();
            }

            if (moveLogic == null)
            {
                moveLogic = new MoveLogic();
            }

            if (eventData is SCPointEventData)
            {
                SCPointEventData scPointEventData = eventData as SCPointEventData;
                eventDataDic[scPointEventData.inputDevicePartBase.PartType] = scPointEventData;
                if (scPointEventData.inputDevicePartBase is InputDeviceHandPart)
                {
                    devicePartManipulation = new HandDevicePartManipulation();
                }
                else if (scPointEventData.inputDevicePartBase is InputDeviceGCPart)
                {
                    devicePartManipulation = new GameControllerDevicePartManipulation();
                }
                else if (scPointEventData.inputDevicePartBase is InputDeviceHeadPart)
                {
                    devicePartManipulation = new HeadDevicePartManipulation();
                }
            }

            //Two DevicePart
            if (eventDataDic.Count > 1)
            {
                devicePartCountManipulation = new TwoDevicePartCountManipulation();
                devicePartCountManipulation.Init(devicePartManipulation, eventDataDic, Target == null ? this.transform : Target.transform, moveLogic, canTwoHandRotate ? rotateLogic : null, canTwoHandScale ? scaleLogic : null);
            }
            //One DevicePart
            else if (eventDataDic.Count == 1)
            {
                devicePartCountManipulation = new OneDevicePartCountManipulation();
                devicePartCountManipulation.Init(devicePartManipulation, eventDataDic, Target == null ? this.transform : Target.transform, moveLogic, canOneHandRotate ? rotateLogic : null, null);
            }

            rigidBody = Target == null?this.GetComponent <Rigidbody>() : Target.GetComponent <Rigidbody>();

            if (rigidBody != null)
            {
                wasKinematic          = rigidBody.isKinematic;
                rigidBody.isKinematic = true;
            }

            AudioSystem.getInstance.PlayAudioOneShot(gameObject, StartAudio);
        }