Its not open source now..
gdxu / incomplete-runningman Goto Github PK
View Code? Open in Web Editor NEWUnity asset store GHOST PROJECT
License: Apache License 2.0
Unity asset store GHOST PROJECT
License: Apache License 2.0
public Slider speedControlSlider;
public controlNormal shipcontrolengine;
// Use this for initialization
void Start ()
{
if (speedControlSlider != null) {
speedControlSlider.onValueChanged.AddListener (onSpeedChange);
}
}
// Update is called once per frame
void Update ()
{
}
public void onSpeedChange (float val)
{
if (shipcontrolengine != null) {
shipcontrolengine.setExternalSpeedCurrent (val / 100);
}
}
using UnityEngine;
using System.Collections;
public class RezzerOnSphere : MonoBehaviour
{
public float angleControl = 90F, minDistance, maxDistance;
public int objectCountMin, objectCountMax;
public GameObject fab;
// Use this for initialization
void Start ()
{
if (objectCountMin > objectCountMax) {
Debug.LogError ("objectCountMin needs to be smaller than objectCountMax");
return;
}
if (objectCountMax < 1) {
Debug.LogError ("objectCountMax needs to be bigger than zero;");
return;
}
for (int i = 0; i<50; i++) {
// Vector3 V = GetPointOnUnitSphereCap (transform.rotation, angleControl);
Vector3 V = GenerateRandomPos ();
// Debug.DrawRay (transform.position, V, Color.red);
if (fab != null) {
Quaternion rot = Quaternion.Euler (getNormal (V));
//* Vector3.up;
GameObject openobject = Instantiate (fab, V, Quaternion.identity) as GameObject;
//Quaternion currentRot = T.localRotation;
openobject.transform.rotation = Quaternion.FromToRotation (-openobject.transform.up, getNormal (V)) * openobject.transform.rotation;
//T.transform.rotation = Quaternion.Euler (getNormal (V)) * -T.transform.up;
//Quaternion.LookRotation(Vector3.up * getNormal(V)
//openobject.transform.LookAt (getNormal (V));
openobject.transform.parent = GameObject.FindGameObjectWithTag ("Ground").transform;
//T.transform.TransformPoint (Quaternion.Euler (getNormal (V)) * Vector3.up);
}
}
}
public Vector3 getNormal (Vector3 vpos)
{
Vector3 t = GetComponent<Transform> ().position - vpos;
float distance = t.magnitude;
return t / distance;
}
// Update is called once per frame
void Update ()
{
}
public Vector3 GenerateRandomPos ()
{
Vector3 newPos = Random.onUnitSphere * Random.Range (minDistance, maxDistance);
// newPos.y = originalPos.y;
return newPos;
}
public Vector3 GetPointOnUnitSphereCap (Quaternion targetDirection, float angle)
{
float angleInRad = Random.Range (0.0F, angle) * Mathf.Rad2Deg;
Vector3 pointoncircle = (Random.insideUnitCircle.normalized) * Mathf.Sin (angleInRad);
float distance = Mathf.Tan (angleInRad);
Vector2 PointOnCircle = Random.insideUnitCircle;
//Mathf.Cos(angleInRad)
Vector3 V = new Vector3 (PointOnCircle.x, PointOnCircle.y, distance);
return targetDirection * V;
}
}
The new articles about future tech.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.