Inheritance: MonoBehaviour
Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        itemEquipping        = false;
        itemReady            = false;
        instructions.enabled = false;
        itemPreviousParent   = item.transform.parent;
        if (!equipPoint.GetComponentInParent <Camera> ())
        {
            Debug.LogError("EquipObject: equipPoint must be child of a Camera component");
        }
        camParent = equipPoint.GetComponentInParent <Camera> ().transform;

        // set up the idle rotator
        if (!item.GetComponent <ItemRotator>())
        {
            item.gameObject.AddComponent <ItemRotator>();
        }
        itemSpinner = item.GetComponent <ItemRotator> ();
        itemSpinner.yDegreesPerSecond = spinSpeed;
        itemSpinner.xDegreesPerSecond = itemSpinner.zDegreesPerSecond = 0;
        itemSpinner.enabled           = true;
    }
	public void SetRotator(ItemRotator itm)
	{
		rotator = itm;
		rotator.target = bikesContols [data.currentBike].transform;
	}
Ejemplo n.º 3
0
 public void SetRotator(ItemRotator itm)
 {
     rotator        = itm;
     rotator.target = bikesContols [data.currentBike].transform;
 }