private void Awake() { //Get all the interfaces the input will be interacting with movable = GetComponent <IMovable>(); rotable = GetComponent <IRotable>(); shootable = GetComponent <IShootable>(); }
public RotationCloneControl(ISceneObject cloned) { if (!(cloned is IRotable)) { throw new ArgumentException("RotationCloneControl must clone an IRotable object"); } this.cloned = cloned as IRotable; }
protected override void InitControl(ISceneObject obj) { if (!(obj is IRotable)) { Logger.Error("LinearRotationControl cannot be attached to non-rotable object!"); return; } meRotable = obj as IRotable; }
public static void SetEulerAngles(this IRotable o, Euler orientation) { o.LocalRotation = orientation.ToMatrix(); }
public static Euler GetEulerAngles(this IRotable o) { return(Euler.FromMatrix(o.LocalRotation)); }