Inheritance: MonoBehaviour
	// Use this for initialization
	void Start () {
		//selectieScript.lastGameObjectHit = null;
		lastHooveredGameObject = null;
	
		//Set ref script
		raycastscript = gameObject.GetComponent("RayCastScript") as RayCastScript;
		rotateScript = gameObject.GetComponent("RotateScript") as RotateScript;
		scaleScript = gameObject.GetComponent("ScaleScript") as ScaleScript;
		stackScript = gameObject.GetComponent("StackScript") as StackScript;
		moveScript = gameObject.GetComponent("MoveScript") as MoveScript;
		smoothCameraScript = gameObject.GetComponent("SmoothCameraScript") as SmoothCameraScript;
		verwijderScript = gameObject.GetComponent("VerwijderScript") as VerwijderScript;
		selectieScript = gameObject.GetComponent("SelectieScript") as SelectieScript;
		selectieScript.setSelectionmodeOn();
		selectieScript.playerCam = playerCam;
		
		//Turn off mouse pointer and set the cursorImage
		screenpointer = (GUITexture)Instantiate(baseGuiTexture);
		Screen.showCursor = false; 
		screenpointer.texture = cursorImage;
		screenpointer.color = Color.red;
		screenpointer.pixelInset = new Rect(-5, -5,10,10);
		screenpointer.transform.localScale -= new Vector3(1, 1, 0);
		
		modus = Modi.NAV_SEL;
	}
    // Use this for initialization
    void Start()
    {
        //Init controllers
        wiimote_start();

        //Turn off mouse pointer and set the cursorImage
        screenpointer                       = (GUITexture)Instantiate(baseGuiTexture);
        Screen.showCursor                   = false;
        screenpointer.texture               = cursorImage;
        screenpointer.color                 = Color.red;
        screenpointer.pixelInset            = new Rect(10, 10, 10, 10);
        screenpointer.transform.localScale -= new Vector3(1, 1, 0);

        //Set ref scripts
        raycastscript      = gameObject.GetComponent("RayCastScript") as RayCastScript;
        rotateScript       = gameObject.GetComponent("RotateScript") as RotateScript;
        scaleScript        = gameObject.GetComponent("ScaleScript") as ScaleScript;
        stackScript        = gameObject.GetComponent("StackScript") as StackScript;
        moveScript         = gameObject.GetComponent("MoveScript") as MoveScript;
        smoothCameraScript = gameObject.GetComponent("SmoothCameraScript") as SmoothCameraScript;
        verwijderScript    = gameObject.GetComponent("VerwijderScript") as VerwijderScript;
        selectieScript     = gameObject.GetComponent("SelectieScript") as SelectieScript;

        //Set initial values
        selectieScript.setSelectionmodeOn();
        selectieScript.playerCam = playerCam;
        modus = Modi.NAV_SEL;
    }
    public void Rotate(RotateScript rotator, bool UseRotationSpeeds = true)
    {
        var delta = rotator.DesiredRotation - rotator.CurrentRotation;

        if (UseRotationSpeeds)
        {
            var maxRot = rotateSpeed * Time.deltaTime;
            var minRot = -rotateSpeed * Time.deltaTime;
            if (delta < -180)
            {
                delta += 360;               // Go around the other way
            }
            if (delta > 180)
            {
                delta -= 360;              // Go around the other way
            }
            delta = Mathf.Clamp(delta, minRot, maxRot);
            if (OnSegmentMove != null)
            {
                OnSegmentMove.Invoke(delta);
            }
        }

        rotator.transform.Rotate(0, delta, 0);
        rotator.CurrentRotation += delta;
    }
Example #4
0
    public void Start()
    {
        image = transform.GetComponent <Image>();
        r     = cube.GetComponent <RotateScript>();
        //Adds a listener to the main input field and invokes a method when the value changes.
#pragma warning disable CS0618 // Type or member is obsolete
        mainInputField.onValueChange.AddListener(delegate { ValueChangeCheck(); });
#pragma warning restore CS0618 // Type or member is obsolete
    }
Example #5
0
    void Start()
    {
        rotateScript = GetComponent <RotateScript>();

        FinishLineReached.OnFinishLineReached += EnableRotateScript;
        PlayerCollisions.OnObstacleHit        += DisableRotateScript;


        transform.position = Vector3.zero;

        //transform.DOMoveY(0.2f, 0.5f);
    }
Example #6
0
    private void Start()
    {
        jumpScript   = GetComponent <JumpScript>();
        rb           = GetComponent <Rigidbody2D>();
        rotateScript = GetComponent <RotateScript>();
        spring       = GetComponent <SpringJoint2D>();

        animator = GetComponent <Animator>();

        spawner = GameObject.FindGameObjectWithTag("spawner");
        PlayerCollisions.OnObstacleHit += OnDeath;

        initialPos = transform.position;
    }
Example #7
0
    private void Awake()
    {
        GameObject sphere  = transform.Find("Crystal Sphere").gameObject;
        GameObject glitter = transform.Find("Glitter").gameObject;

        sphereRS  = sphere.GetComponent <RotateScript>();
        glitterRS = glitter.GetComponent <RotateScript>();

        //establish parameter hash:
        float     t  = 25f;
        Hashtable ht = iTween.Hash("from", -spinVal, "to", spinVal, "easetype", iTween.EaseType.easeInOutSine, "looptype", iTween.LoopType.pingPong, "time", t, "onupdate", "ChangeSpinValue");

        //make iTween call:
        iTween.ValueTo(gameObject, ht);
    }
	// Use this for initialization
	void Start () {
		//Set ref script
		raycastscript = gameObject.GetComponent("RayCastScript") as RayCastScript;
		rotateScript = gameObject.GetComponent("RotateScript") as RotateScript;
		scaleScript = gameObject.GetComponent("ScaleScript") as ScaleScript;
		stackScript = gameObject.GetComponent("StackScript") as StackScript;		
		moveScript = gameObject.GetComponent("MoveScript") as MoveScript;
		
		//Turn off mouse pointer and set the cursorImage
		screenpointer = (GUITexture)Instantiate(baseGuiTexture);
		Screen.showCursor = false; 
		screenpointer.texture = cursorImage;
		screenpointer.color = Color.red;
		screenpointer.pixelInset = new Rect(10,10,10,10);
		screenpointer.transform.localScale -= new Vector3(1, 1, 0);
	}
    // Use this for initialization
    void Start()
    {
        //Set ref script
        raycastscript = gameObject.GetComponent("RayCastScript") as RayCastScript;
        rotateScript  = gameObject.GetComponent("RotateScript") as RotateScript;
        scaleScript   = gameObject.GetComponent("ScaleScript") as ScaleScript;
        stackScript   = gameObject.GetComponent("StackScript") as StackScript;
        moveScript    = gameObject.GetComponent("MoveScript") as MoveScript;

        //Turn off mouse pointer and set the cursorImage
        screenpointer                       = (GUITexture)Instantiate(baseGuiTexture);
        Screen.showCursor                   = false;
        screenpointer.texture               = cursorImage;
        screenpointer.color                 = Color.red;
        screenpointer.pixelInset            = new Rect(10, 10, 10, 10);
        screenpointer.transform.localScale -= new Vector3(1, 1, 0);
    }
Example #10
0
    public override void Enter(IAgent pAgent)
    {
        player = GameObject.FindGameObjectWithTag("Player");

        jumpScript   = player.GetComponent <JumpScript>();
        rotateScript = player.GetComponent <RotateScript>();

        base.Enter(pAgent);

        levelCanvas.SetActive(true);

        finishLine.SetActive(true);
        levelManagers.SetActive(true);
        jumpScript.enabled     = true;
        rotateScript.enabled   = true;
        spawnObstacles.enabled = true;
        menuCanvas.SetActive(false);
    }
Example #11
0
    // Update is called once per frame
    void Update()
    {
        if (player == null)
        {
            player = GameObject.FindGameObjectWithTag("Player");
        }


        if (player != null && !init)
        {
            rotateScript = player.GetComponent <RotateScript>();
            jumpScript   = player.GetComponent <JumpScript>();

            rotateScript.enabled = true;
            jumpScript.enabled   = true;

            init = true;
        }
    }
Example #12
0
    // Use this for initialization
    void Start()
    {
        rotateScript = GetComponent <RotateScript>();

        FinishLineReached.OnFinishLineReached += RotateBackwards;
    }
    // Use this for initialization
    void Start()
    {
        //Init controllers
        wiimote_start();

        //Turn off mouse pointer and set the cursorImage
        screenpointer = (GUITexture)Instantiate(baseGuiTexture);
        Cursor.visible = false;
        screenpointer.texture = cursorImage;
        screenpointer.color = Color.red;
        screenpointer.pixelInset = new Rect(10,10,10,10);
        screenpointer.transform.localScale -= new Vector3(1,1,0);

        //Set ref scripts
        raycastscript = gameObject.GetComponent("RayCastScript") as RayCastScript;
        rotateScript = gameObject.GetComponent("RotateScript") as RotateScript;
        scaleScript = gameObject.GetComponent("ScaleScript") as ScaleScript;
        stackScript = gameObject.GetComponent("StackScript") as StackScript;
        moveScript = gameObject.GetComponent("MoveScript") as MoveScript;
        smoothCameraScript = gameObject.GetComponent("SmoothCameraScript") as SmoothCameraScript;
        verwijderScript = gameObject.GetComponent("VerwijderScript") as VerwijderScript;
        selectieScript = gameObject.GetComponent("SelectieScript") as SelectieScript;

        //Set initial values
        selectieScript.setSelectionmodeOn();
        selectieScript.playerCam = playerCam;
        modus = Modi.NAV_SEL;
    }
 public void SetRotation(RotateScript rotator, float position)
 {
     rotator.DesiredRotation = (position + 1.0f) * 180; // range: 0 to 2 * 180 = 0 to 360
 }
Example #15
0
 void Start()
 {
     input = GetComponent <InputField>();
     r     = cube.GetComponent <RotateScript>();
 }
    // Use this for initialization
    private void Start()
    {
        rotateScript = GetComponent <RotateScript>();

        FinishLineReached.OnFinishLineReached += IncreaseSpeed;
    }