Hi,
I have done some research on a bunch of different forums, and on the web in general, and I can’t seem to figure out this issue with my script. Note: I am very new to C#, and this could very well be a syntax error or something like that. I am trying to create a script that I can attach to a camera, and using touch screen gestures, transition to a new camera. My particular game has no game objects or player characters, so I assumed I would have to attach to camera. So I am trying to implement both “Camera Transitions”, and “Easy Touch” into this script. If anyone knows anything about these two addons and could help me, it would be much appreciated. I have looked through documentation for both plugins, and have been able to get rid of a few errors, but I still have one that persists. Here is the error:
Assets/GesturesTransitions.cs(25,54): error CS0118: UnityEngine.Object.FindObjectOfType<T>()' is a method group’ but a `type’ was expected
If I need to provide any more info, I will be more than happy to provide it. Here is my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using CameraTransitions;
using HedgehogTeam.EasyTouch;
public class GesturesTransitions : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void On_Swipe (Gesture gesture) {
Camera camorig;
Camera camleft;
Camera camright;
CameraTransition cameraTransition = new GameObject.FindObjectOfType();
if (cameraTransition == null) {
Debug.LogWarning (@“CameraTransition not found.”);
}
else {
if (gesture.swipe == EasyTouch.SwipeDirection.Left) {
cameraTransition.DoTransition (CameraTransitionEffects.Fold, camorig, camleft, 1.0f);
} else if (gesture.swipe == EasyTouch.SwipeDirection.Right) {
cameraTransition.DoTransition (CameraTransitionEffects.Fold, camorig, camright, 1.0f);
} else {
Debug.LogWarning (@“Swipe not completed.”);
}
}
}
}
Thanks in advance for any help!
cstobler