void Start() { sr = transform.rotation; sr.Duration = 0.5f; FindPathByObjects = GameObject.FindGameObjectsWithTag("WayPoint"); path = new Transform[FindPathByObjects.Length]; Array.Sort(FindPathByObjects, CompareObNames); for (int i = 0; i < FindPathByObjects.Length; i++) { path[i] = FindPathByObjects[i].transform; } //Array.Sort(path); GizmoPath = new Vector3[path.Length]; position = transform.position; for (int i = 0; i < path.Length; i++) { GizmoPath[i] = path[i].position; } }
void Start() { quaternion = transform.rotation; quaternion.Duration = .5f; // get the debug config unless we are in the small intestine tutorial if (Application.loadedLevelName != "SmallIntestineTutorial") { debugConfig = ((GameObject)GameObject.Find("Debug Config")).GetComponent <DebugConfig>(); } }
EsophagusDebugConfig debugConfig; //!< to hold a reference to the mouth debug config /** * Use this for initialization * Finds references and initializes values. */ void Start() { GameObject flaps = GameObject.Find("Flaps"); // find the reference to the flaps flap = flaps.GetComponent <openFlap>(); // find the script on the flaps quaternion = transform.rotation; quaternion.Duration = .5f; debugConfig = GameObject.Find("Debugger").GetComponent <EsophagusDebugConfig>(); // find the reference to the debugger b = GameObject.Find("flap1").GetComponent <BoxCollider> (); }
//Use this instead of Awake since this is a MonoBehaviorSingleton //void Awake() protected override void Initialize() { //Expect a Camera component in this class' object ourCamera = transform.GetComponent <Camera>() as Camera; if (ourCamera == null) { Debug.LogError("camera == null"); } lookAtTarget = Vector3.zero; //Smoothing helpers posSmoother = new SmoothVector3(Vector3.zero); rotSmoother = new SmoothQuaternion(Quaternion.identity); followHmdEnabled = false; }
void Start() { // Model bones headBone = transform.FindChild("Fish/Armature/Bone_001"); bodyBone = transform.FindChild("Fish/Armature/Bone_001/Bone_002/Bone_003"); tailBone = transform.FindChild("Fish/Armature/Bone_001/Bone_002/Bone_003/Bone_004"); // Bone rotations to lerp with bodyRotation = transform.rotation; bodyRotation.Duration = bodyRotationVelocity; fishRotation = transform.rotation; fishRotation.Duration = bodyRotationVelocity / 2; headRotation = transform.rotation; headRotation.Duration = bodyRotationVelocity / 5; generalToBone = Quaternion.Inverse(transform.rotation) * bodyBone.rotation; path.Add(transform.position); lineRenderer = Camera.mainCamera.gameObject.AddComponent <LineRenderer>(); lineRenderer.SetWidth(0.0f, 0.0f); }
void Start() { sr = transform.rotation; sr.Duration = 0.5f; FindPathByObjects = GameObject.FindGameObjectsWithTag("WayPoint"); path = new Transform[FindPathByObjects.Length]; Array.Sort(FindPathByObjects, CompareObNames); for(int i = 0; i < FindPathByObjects.Length; i++) { path[i] = FindPathByObjects[i].transform; } //Array.Sort(path); GizmoPath = new Vector3[path.Length]; position = transform.position; for(int i = 0; i < path.Length; i++) { GizmoPath[i] = path[i].position; } }
// Use this for initialization void Start () { smoothQ = transform.rotation; startingRotation = transform.rotation; smoothQ.Duration = 0.5f; }