Example #1
0
    void Awake()
    {
        jod      = GetComponent <JamoDrum> ();
        jodkey   = GetComponent <JamoDrumKeyVersion> ();
        launcher = GetComponent <SingleLauncher> ();
        platform = GameObject.Find("TracingPanel")
                   .GetComponent <TracingPanel>();
        spawn = GameObject.FindGameObjectWithTag("SpawnController")
                .GetComponent <SpawnMarbles>();
        soundManager = GameObject.Find("SoundManager")
                       .GetComponent <SoundManagerScript>();

        if (launcher.key)
        {
            jodkey.AddHitEvent(HitHandler);
            jodkey.AddSpinEvent(SpinHandler);
        }
        else
        {
            jod.AddHitEvent(HitHandler);
            jod.AddSpinEvent(SpinHandler);
        }

        stateStartAction = () => {
            stateTimer  = 0f;
            heroTapSum  = 0;
            heroSpinSum = 0;
        };
    }
Example #2
0
	void Awake () {
		jod = GetComponent<JamoDrum> ();
		jodkey = GetComponent<JamoDrumKeyVersion> ();
		launcher = GetComponent<SingleLauncher> ();
		platform = GameObject.Find("TracingPanel")
			.GetComponent<TracingPanel>();
		spawn = GameObject.FindGameObjectWithTag("SpawnController")
			.GetComponent<SpawnMarbles>();
		soundManager = GameObject.Find ("SoundManager")
			.GetComponent<SoundManagerScript>();

		if (launcher.key) {
			jodkey.AddHitEvent(HitHandler);
			jodkey.AddSpinEvent(SpinHandler);
		}
		else {
			jod.AddHitEvent(HitHandler);
			jod.AddSpinEvent(SpinHandler);
		}

		stateStartAction = () => {
			stateTimer = 0f;
			heroTapSum = 0;
			heroSpinSum = 0;
		};
	}
Example #3
0
	void Awake () {
		jod = GameObject.Find ("JamODrum").GetComponent<JamoDrum>();
		jodkey = GameObject.Find ("JamODrum").GetComponent<JamoDrumKeyVersion>();

		if (key) {
			jodkey.AddHitEvent(HitHandler);
			jodkey.AddSpinEvent(SpinHandler);
		}
		else {
			jod.AddHitEvent(HitHandler);
			jod.AddSpinEvent(SpinHandler);
		}
	}
Example #4
0
    void Awake()
    {
        jod    = GameObject.Find("JamODrum").GetComponent <JamoDrum>();
        jodkey = GameObject.Find("JamODrum").GetComponent <JamoDrumKeyVersion>();

        if (key)
        {
            jodkey.AddHitEvent(HitHandler);
            jodkey.AddSpinEvent(SpinHandler);
        }
        else
        {
            jod.AddHitEvent(HitHandler);
            jod.AddSpinEvent(SpinHandler);
        }
    }
Example #5
0
	void Awake () {
		jod = GetComponent<JamoDrum>();
		jodkey = GetComponent<JamoDrumKeyVersion>();
		villainController = GetComponent<VillainController>();
		villainController.RegisterMagicEndAction(ResetAllSpinners);
		villainController.RegisterMagicEndAction(UnlockAllDrums);
		//villainController.RegisterMagicEndAction(UnlockAllCannons);

		if (key) {
			jodkey.AddHitEvent(HitHandler);
			jodkey.AddSpinEvent(SpinHandler);
		}
		else {
			jod.AddHitEvent(HitHandler);
			jod.AddSpinEvent(SpinHandler);
		}
	}
Example #6
0
    void Awake()
    {
        jod               = GetComponent <JamoDrum>();
        jodkey            = GetComponent <JamoDrumKeyVersion>();
        villainController = GetComponent <VillainController>();
        villainController.RegisterMagicEndAction(ResetAllSpinners);
        villainController.RegisterMagicEndAction(UnlockAllDrums);
        //villainController.RegisterMagicEndAction(UnlockAllCannons);

        if (key)
        {
            jodkey.AddHitEvent(HitHandler);
            jodkey.AddSpinEvent(SpinHandler);
        }
        else
        {
            jod.AddHitEvent(HitHandler);
            jod.AddSpinEvent(SpinHandler);
        }
    }
Example #7
0
    // Update is called once per frame
    void Update()
    {
        if (!key)
        {
            if (!once)
            {
                once = true;
                jod.AddHitEvent(HitHandler);
                jod.AddSpinEvent(SpinHandler);
            }
            for (int i = 0; i < 4; i++)
            {
                //spin
                hits[i] = jod.hit[i];
                if (Mathf.Abs(jod.spinDelta [i]) > 0)
                {
                    Debug.Log("EXAMPLE SPIN " + i);
                    spinnerAngle [i] += jod.spinDelta [i] * degPerTick [i];

                    /*
                     * if (spinnerAngle[i] > 45.0f) {
                     *      spinnerAngle[i] = 45.0f;
                     * }
                     * if (spinnerAngle[i] < -45.0f) {
                     *      spinnerAngle[i] = -45.0f;
                     * }
                     */
                    //spinnerAngle[i] += jod.spinDelta[i];
                    Debug.Log("Spin " + i + " : " + jod.spinDelta [i]);
                    spinnerAngle [i] = Mathf.Repeat(spinnerAngle [i], 360);
                    Vector3 rot = spinners [i].transform.rotation.eulerAngles;
                    rot.y = initAngle [i] + spinnerAngle [i];
                    spinners [i].transform.rotation = Quaternion.Euler(rot);
                }
                //hit
                if (jod.hit [i])
                {
                    Debug.Log("EXAMPLE HIT " + i);

                    /*
                     * GameObject starInst = (GameObject)Instantiate (star);
                     * starInst.GetComponent<Renderer> ().material = starMaterials [i];
                     * switch (i) {
                     * case 0:
                     *      starInst.transform.position = new Vector3 (-5, 35, 5);
                     *      break;
                     * case 1:
                     *      starInst.transform.position = new Vector3 (5, 35, 5);
                     *      break;
                     * case 2:
                     *      starInst.transform.position = new Vector3 (5, 35, -5);
                     *      break;
                     * case 3:
                     *      starInst.transform.position = new Vector3 (-5, 35, -5);
                     *      break;
                     * }
                     */
                }
            }

            if (Input.GetKeyUp(KeyCode.Escape))
            {
                Application.Quit();
            }
        }
        else
        {
            if (!once)
            {
                once = true;
                jodk.AddHitEvent(HitHandler);
                jodk.AddSpinEvent(SpinHandler);
            }
            for (int i = 0; i < 4; i++)
            {
                //spin
                hits[i] = jodk.hit[i];
                if (Mathf.Abs(jodk.spinDelta [i]) > 0)
                {
                    Debug.Log("EXAMPLE SPIN " + i);
                    spinnerAngle [i] += jodk.spinDelta [i] * degPerTick [i];
                    //spinnerAngle[i] += jod.spinDelta[i];
                    Debug.Log("Spin " + i + " : " + jodk.spinDelta [i]);

                    /*
                     * if (spinnerAngle[i] > 45.0f) {
                     *      spinnerAngle[i] = 45.0f;
                     * }
                     * if (spinnerAngle[i] < -45.0f) {
                     *      spinnerAngle[i] = -45.0f;
                     * }
                     */
                    spinnerAngle [i] = Mathf.Repeat(spinnerAngle [i], 360);
                    Vector3 rot = spinners [i].transform.rotation.eulerAngles;
                    rot.y = initAngle [i] + spinnerAngle [i];
                    spinners [i].transform.rotation = Quaternion.Euler(rot);
                }
                //hit
                if (jodk.hit [i])
                {
                    Debug.Log("EXAMPLE HIT " + i);

                    /*
                     * GameObject starInst = (GameObject)Instantiate (star);
                     * starInst.GetComponent<Renderer> ().material = starMaterials [i];
                     * switch (i) {
                     * case 0:
                     *      starInst.transform.position = new Vector3 (-5, 35, 5);
                     *      break;
                     * case 1:
                     *      starInst.transform.position = new Vector3 (5, 35, 5);
                     *      break;
                     * case 2:
                     *      starInst.transform.position = new Vector3 (5, 35, -5);
                     *      break;
                     * case 3:
                     *      starInst.transform.position = new Vector3 (-5, 35, -5);
                     *      break;
                     * }
                     */
                }
            }

            if (Input.GetKeyUp(KeyCode.Escape))
            {
                Application.Quit();
            }
        }
    }