##Converting an array of floats to string
using System.Collections.Generic;
//...
Vector3[] ConvertToVector3Array (float[] floats)
{
List vector3List = new List();##Converting an array of floats to string
using System.Collections.Generic;
//...
Vector3[] ConvertToVector3Array (float[] floats)
{
List vector3List = new List();| public class MusicManager : MonoBehaviour | |
| { | |
| //We make a static variable to our MusicManager instance | |
| public static MusicManager instance { get; private set; } | |
| //When the object awakens, we assign the static variable | |
| void Awake() | |
| { | |
| instance = this; | |
| } |
string testEchoString = "test echo string";
IntPtr echoedStringPtr = EchoBack(testEchoString);
String echoed = Marshal.PtrToStringAnsi(echoedStringPtr);http://forum.unity3d.com/threads/c-plugin-getting-a-string-back-from-a-function.123594/
| <html> | |
| <head> | |
| <title>This page is under construction</title> | |
| <style> | |
| .outer { | |
| display: table; |
/// <summary>
/// Extension method for UnityEngine.Transform.
/// Finds the children with tag.
/// Returns an array.
/// </summary>
/// <returns>The children with tag.</returns>
/// <param name="tag">Tag.</param>
public static Transform[] FindChildrenWithTag(this Transform trans, string tag)
{ /// <summary>
/// Determines if is between the specified float is between two given floats.
/// </summary>
/// <returns><c>true</c> if the float is between the specified num lower upper inclusive; otherwise, <c>false</c>.</returns>
/// <param name="num">Number.</param>
/// <param name="lower">Lower.</param>
/// <param name="upper">Upper.</param>
/// <param name="inclusive">If set to <c>true</c> inclusive.</param>
public static bool IsBetween (this float num, float lower, float upper, bool inclusive = false) RaycastHit RaycastFromCenter()
{
// Determine if we hit anything
Ray ray = Camera.main.ViewportPointToRay(new Vector3(0.5F, 0.5F, 0));
RaycastHit hit;
if (Physics.Raycast (ray, out hit))
{
return hit;
} /// <summary>
/// Raycasts from center.
/// </summary>
/// <returns>RaycastHit if something is hit, or null if nothing is hit.</returns>
/// https://gist.github.com/Ashwinning/d87e014cce668411adb9
RaycastHit RaycastFromCenter
{
get
{| /// <summary> | |
| /// Rotates the point around a pivot. | |
| /// </summary> | |
| /// <returns>The rotated point.</returns> | |
| /// <param name="point">Point.</param> | |
| /// <param name="pivot">Pivot.</param> | |
| /// <param name="rotation">Rotation.</param> | |
| public Vector3 RotatePointAroundPivot (Vector3 point, Vector3 pivot, Quaternion rotation) | |
| { | |
| Vector3 direction = point - pivot; //Get point's direction relative to the pivot |
| using UnityEngine; | |
| using System; | |
| using System.Linq; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Runtime.InteropServices; | |
| /// <summary> | |
| /// The following example saves a Vector 3 List to a '.cloud' file. | |
| /// </summary> |