Inheritance: MonoBehaviour
コード例 #1
0
	// 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;
	}
コード例 #2
0
    // 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;
    }
コード例 #3
0
    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;
    }
コード例 #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
    }
コード例 #5
0
ファイル: LookAtPlayer.cs プロジェクト: igli15/Circly-Fly
    void Start()
    {
        rotateScript = GetComponent <RotateScript>();

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


        transform.position = Vector3.zero;

        //transform.DOMoveY(0.2f, 0.5f);
    }
コード例 #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;
    }
コード例 #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);
    }
コード例 #8
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);
	}
コード例 #9
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);
    }
コード例 #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);
    }
コード例 #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;
        }
    }
コード例 #12
0
    // Use this for initialization
    void Start()
    {
        rotateScript = GetComponent <RotateScript>();

        FinishLineReached.OnFinishLineReached += RotateBackwards;
    }
コード例 #13
0
    // 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;
    }
コード例 #14
0
 public void SetRotation(RotateScript rotator, float position)
 {
     rotator.DesiredRotation = (position + 1.0f) * 180; // range: 0 to 2 * 180 = 0 to 360
 }
コード例 #15
0
 void Start()
 {
     input = GetComponent <InputField>();
     r     = cube.GetComponent <RotateScript>();
 }
コード例 #16
0
    // Use this for initialization
    private void Start()
    {
        rotateScript = GetComponent <RotateScript>();

        FinishLineReached.OnFinishLineReached += IncreaseSpeed;
    }