Graphics Reference
In-Depth Information
public class BaseTopDownSpaceShip : ExtendedCustomMonoBehavior
{
private Quaternion targetRotation;
private float thePos;
private float moveXAmount;
private float moveZAmount;
public float moveXSpeed=40f;
public float moveZSpeed=15f;
public float limitX=15f;
public float limitZ=15f;
private float originZ;
[System.NonSerialized]
public Keyboard_Input default_input;
public float horizontal_input;
public float vertical_input;
public virtual void Start()
{
// we are overriding Start() so as not to call Init, as we
// want the game controller to do this in this game.
didInit=false;
this.Init();
}
public virtual void Init ()
{
// cache refs to our transform and gameObject
myTransform= transform;
myGO= gameObject;
myBody= rigidbody;
// add default keyboard input
default_input= myGO.AddComponent<Keyboard_Input>();
// grab the starting Z position to use as a baseline for Z
// position limiting
originZ=myTransform.localPosition.z;
// set a flag so that our Update function knows when we are OK
// to use
didInit=true;
}
public virtual void GameStart ()
{
// we are good to go, so let's get moving!
canControl=true;
}
public virtual void GetInput ()
{
Search WWH ::




Custom Search