Пример #1
0
	protected override void CustomGui()
	{
		if (Application.isPlaying)
		{
			itsModuleTouch = (KGFTouch)target;
			
			if (itsModuleTouch.itsDebugMode)
			{
				StartBlock();
				itsOptions = EditorGUILayout.Foldout(itsOptions,"Debug Events");
				if (itsOptions)
				{
					DisplayOptions();
				}
				EndBlock();
				
				StartBlock();
				itsDisabled = EditorGUILayout.Foldout(itsDisabled,"Disabled Areas");
				if (itsDisabled)
				{
					DisplayDisabledAreas();
				}
				EndBlock();
			}
		}
	}
Пример #2
0
    protected override void CustomGui()
    {
        if (Application.isPlaying)
        {
            itsModuleTouch = (KGFTouch)target;

            if (itsModuleTouch.itsDebugMode)
            {
                StartBlock();
                itsOptions = EditorGUILayout.Foldout(itsOptions, "Debug Events");
                if (itsOptions)
                {
                    DisplayOptions();
                }
                EndBlock();

                StartBlock();
                itsDisabled = EditorGUILayout.Foldout(itsDisabled, "Disabled Areas");
                if (itsDisabled)
                {
                    DisplayDisabledAreas();
                }
                EndBlock();
            }
        }
    }
Пример #3
0
	/// <summary>
	/// Called on touch ended
	/// </summary>
	public virtual void OnEventTouchEnded(KGFTouch.TouchArgs theArgs)
	{
		if (EventTouchEnded != null)
			EventTouchEnded(this,theArgs);
	}
Пример #4
0
	/// <summary>
	/// Called on pan event
	/// </summary>
	public virtual void OnEventPan(KGFTouch.PanArgs theArgs)
	{
		if (EventPan != null)
			EventPan(this,theArgs);
	}
Пример #5
0
	/// <summary>
	/// Called on pinch event
	/// </summary>
	public virtual void OnEventPinch(KGFTouch.PinchArgs theArgs)
	{
		if (EventPinch != null)
			EventPinch(this,theArgs);
	}
Пример #6
0
	/// <summary>
	/// Called on swipe event
	/// </summary>
	public virtual void OnEventSwipe(KGFTouch.SwipeArgs theArgs)
	{
		if (EventSwipe != null)
			EventSwipe(this,theArgs);
	}
Пример #7
0
	/// <summary>
	/// Called on touch count changed event
	/// </summary>
	public virtual void OnEventTouchCountChanged(KGFTouch.TouchCountChangedArgs theArgs)
	{
		if (EventTouchCountChanged != null)
			EventTouchCountChanged(this,theArgs);
	}
Пример #8
0
	/// <summary>
	/// Default unity3d start method. Used for initialisation
	/// </summary>
	public void Start ()
	{
		#if (UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8) && !UNITY_EDITOR
		itsKGFTouch = KGFAccessor.GetObject<KGFTouch>();
		itsKGFTouch.EventPan += OnTouchPan;
		itsKGFTouch.EventPinch += OnTouchPinch;
		#endif
		
		
		itsEditor = false;
		ApplyStartValues();
		if (itsTarget.itsTarget != null)
		{
			SetTarget(itsTarget.itsTarget);
		}
		else
		{
			itsTargetStartPosition = new Vector3 (0, 0, 0);
		}
		if (itsLookat.itsEnable)
		{
			if(itsLookatTransform != null)
			{
				itsCurrentLookatPosition = itsLookatTransform.position;
			}
			if(itsLookat.itsUpVectorSource != null)
			{
				itsTargetLookatRotation = Quaternion.LookRotation ((itsCurrentLookatPosition - transform.position).normalized, itsLookat.itsUpVectorSource.transform.up);
			}
		}
		else
		{
			if(itsTargetTranform != null)
			{
				itsCurrentLookatPosition = itsTargetTranform.position;
				itsTargetLookatRotation = Quaternion.LookRotation ((itsCurrentLookatPosition - transform.position).normalized, itsTargetTranform.up);
			}
		}
		itsCurrentLookatRotation = itsTargetLookatRotation;
		LateUpdate();
		HandleLookatTarget(true);
	}