Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(transform.gameObject);
        go     = GameObject.Find("SocketIO");
        socket = go.GetComponent <SocketIOComponent>();

        controlobject    = GameObject.FindWithTag("unitychan");
        anim             = controlobject.GetComponent <Animator> ();
        unitychancontrol = controlobject.GetComponent <UnityChanControlScriptWithRgidBody> ();

        headview      = GameObject.FindWithTag("head");
        cardboardhead = headview.GetComponent <CardboardHead> ();
        hit           = new RaycastHit();

        cardboardobject = GameObject.FindWithTag("cardboardmain");
        cardboard       = cardboardobject.GetComponent <Cardboard> ();

        Debug.Log(socket);
        if (socket == null)
        {
            Debug.Log("f**k you!");
        }

        socket.On("connection", Connection);
        socket.On("toclient", Controler);
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        SirenAudioSource = GameObject.FindGameObjectWithTag("AudioSource").GetComponent <AudioSource>();

        // static public変数の初期化
        gameScore = 0;

        // 素体モデルにデータを適用させる
        MyCharDataManager.Instance.ReCreate(sotai);
        MyCharDataManager.Instance.ChangeBodyScaleInGame(BodyNum.NORMAL_BODY);

        // チュートリアルをスキップする処理
        if (TitleManager.tutorialSkipFlag == true)
        {
            tutorialCloseFlag = true;

            tutorialObject.SetActive(false);

            // チュートリアルスキップ時はフェードを考慮する
            count += 1.0f;
        }

        // ゲームの停止
        GameStop();

        // 初期の台をリストに追加
        for (int i = 0; i < firstStands.Length; i++)
        {
            standList.Add(firstStands[i]);
        }
        this.WarningObJectImage = warningObject.GetComponent <Image>();
        player       = GameObject.FindGameObjectWithTag(TagName.TriggerCollider);;
        PlayerRigObj = player.GetComponent <UnityChanControlScriptWithRgidBody>();
        //StartCoroutine("TextCoRoutine");
    }
Exemplo n.º 3
0
    private void SpawnPlayer(int id, Vector3 pos)
    {
        GameObject player;

        if (id == my_id)
        {
            player  = Instantiate(m_ChanPrefab) as GameObject;
            my_chan = player;
        }
        else
        {
            player = Instantiate(m_ChanOtherPrefab) as GameObject;
        }

        player.name = "player " + id;
        player.transform.position = pos;

        FaceController fc = player.GetComponent <FaceController>();

        face_callbacks.Add(id, fc.ChangeFace);

        UnityChanControlScriptWithRgidBody uc = player.GetComponent <UnityChanControlScriptWithRgidBody>();

        input_callbacks.Add(id, uc.UpdatePosition);

        DebugUtils.Log("spawn player {0} - pos:{1}", id, pos);
    }
Exemplo n.º 4
0
	// Use this for initialization
	void Start () 
	{
		attakflag = true;
		attakanim = GetComponentInParent<Animator> ();
		damageErea = GetComponent<GameObject> ();
		unitychancontroller = GameObject.Find ("unitychan_dynamic_locomotion").GetComponent<UnityChanControlScriptWithRgidBody> ();
		lifecount = GameObject.Find ("Life").GetComponent<PlayerHP> ();
		lifecount.UpdateLife (unitychancontroller.playerHP);
	}
Exemplo n.º 5
0
 void Awake()
 {
     AwakeBase();
     _instance = this;
     baseAtk   = 15f;
     baseDef   = 3f;
     control   = GetComponent <UnityChanControlScriptWithRgidBody>();
     shoot     = GetComponentInChildren <PlayerShoot>();
 }
Exemplo n.º 6
0
	// Use this for initialization
	void Start () {
		DontDestroyOnLoad (transform.gameObject);
		go = GameObject.Find ("SocketIO");
		socket = go.GetComponent<SocketIOComponent>();

		controlobject = GameObject.FindWithTag ("unitychan");
		anim = controlobject.GetComponent<Animator> ();
		unitychancontrol = controlobject.GetComponent<UnityChanControlScriptWithRgidBody> ();

		headview = GameObject.FindWithTag ("head");
		cardboardhead = headview.GetComponent<CardboardHead> ();
		hit = new RaycastHit ();

		cardboardobject = GameObject.FindWithTag ("cardboardmain");
		cardboard = cardboardobject.GetComponent<Cardboard> ();

		Debug.Log (socket);
		if (socket == null) {
			Debug.Log("f**k you!");
		}

		socket.On ("connection", Connection);
		socket.On("toclient", Controler);
	}
Exemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     startCB = this.GetComponent <Button>().colors;
     _unityChanControlScriptWith = script.GetComponent <UnityChanControlScriptWithRgidBody>();
 }
Exemplo n.º 8
0
 // Use this for initialization
 void Awake()
 {
     unitychanScript = GameObject.Find("unitychan").GetComponent<UnityChanControlScriptWithRgidBody>();
     timerScript = GetComponent<TimerManager>();
     retryButton = GameObject.Find("RetryButton");
 }
Exemplo n.º 9
0
    void Start()
    {
        anim = GetComponent<Animator>();
        settings = GetComponent<UnityChanControlScriptWithRgidBody>();

        col = GetComponent<CapsuleCollider>();
        rb = GetComponent<Rigidbody>();

        Static = this;
    }
Exemplo n.º 10
0
	// Use this for initialization
	void Start () 
	{
		DamageErea = GetComponent<GameObject> ();
		unitychancontroller = GameObject.Find ("unitychan_dynamic_locomotion").GetComponent<UnityChanControlScriptWithRgidBody> ();
		lifecount = GameObject.Find ("Life").GetComponent<PlayerHP> ();
	}
Exemplo n.º 11
0
 // Use this for initialization
 void Start()
 {
     MyControllerU = gameObject.GetComponent<UnityChanControlScriptWithRgidBody>();
 }
Exemplo n.º 12
0
 // Update is called once per frame
 private void Update()
 {
     t++;
     t = t % 50;
     if (controlScript == null)
     {
         GameObject unityChan = GameObject.Find("Unity-Chan(Clone)/unitychan");
         controlScript = (UnityChanControlScriptWithRgidBody)unityChan.GetComponent("UnityChanControlScriptWithRgidBody");
     }
     rotx = Input.GetAxis("Vertical");
     roty = Input.GetAxis("Horizontal");
     if (Input.GetKeyDown(KeyCode.F) && !menu)
     {
         if (GameManager.select || GameManager.select2 || GameManager.select3)
         {
             if (GameManager.select)
             {
                 //Debug.Log (GameManager.select + " " + GameManager.select2 + " " + GameManager.select3);
                 //GameManager.boxInstance.audio.Play ();
                 this.transform.GetChild(2).audio.Play();
                 GameManager.boxInstance.active = false;
             }
             else if (GameManager.select2)
             {
                 //GameManager.boxInstance2.audio.Play ();
                 this.transform.GetChild(2).audio.Play();
                 GameManager.boxInstance2.active = false;
             }
             else if (GameManager.select3)
             {
                 //GameManager.boxInstance3.audio.Play ();
                 this.transform.GetChild(2).audio.Play();
                 GameManager.boxInstance3.active = false;
             }
             show = false;
             sel  = false;
             menu = false;
             controlScript.interacting = false;
             GameManager.picked       += 1;
             introShown = true;
             introTime  = 5.0f;
             introTime2 = 10.0f;
         }
         else if (GameManager.bossSelect)
         {
             menu = true;
             GameManager.samuraiInstance.audio.Play();
             bossShow = true;
         }
     }
     else if (Input.GetKeyDown(KeyCode.W) && menu)
     {
         if (show)
         {
             ind--;
             if (ind < 0)
             {
                 ind = 1;
             }
         }
         else if (bossShow)
         {
             bossInd--;
             if (bossInd < 0)
             {
                 bossInd = 1;
             }
         }
     }
     else if (Input.GetKeyDown(KeyCode.S) && menu)
     {
         if (show)
         {
             ind++;
             if (ind > 1)
             {
                 ind = 0;
             }
         }
         else if (bossShow)
         {
             bossInd++;
             if (bossInd > 1)
             {
                 bossInd = 0;
             }
         }
     }
     else if (Input.GetKeyDown(KeyCode.F) && menu)
     {
         if (show)
         {
             sel = true;
         }
         else if (bossShow && bossQualify)
         {
             bossSel = true;
         }
         else if (bossShow && !bossQualify)
         {
             bossShow = false;
             menu     = false;
         }
     }        /*
               * if (rotateMode) {
               *     //Debug.Log ("ROTATEMODE");
               *     newRot = r_controller.Rotation;
               *     //Debug.Log ("Rotating with " + rotation);
               *     if(GameManager.select) {
               *             //Debug.Log (GameManager.select + " " + GameManager.select2 + " " + GameManager.select3);
               *             //GameManager.boxInstance.transform.Translate(new Vector3(0,3,0));
               *             GameManager.boxInstance.transform.rotation = newRot;
               *             //GameManager.boxInstance.transform.Translate(new Vector3(0,-3,0));
               *     }
               *     else if(GameManager.select2){
               *             //GameManager.boxInstance2.transform.Translate(new Vector3(0,3,0));
               *             GameManager.boxInstance2.transform.rotation = newRot;
               *             //GameManager.boxInstance2.transform.Translate(new Vector3(0,-3,0));
               *     }
               *     else if(GameManager.select3){
               *             //GameManager.boxInstance3.transform.Translate(new Vector3(0,3,0));
               *             GameManager.boxInstance3.transform.rotation = newRot;
               *             //GameManager.boxInstance3.transform.Translate(new Vector3(0,-3,0));
               *     }
               *     oldRot = newRot;
               *     if (l_controller.GetButtonDown (SixenseButtons.TWO)) {
               *             if (selectedBox == 0) {
               *                     GameManager.boxInstance.rigidbody.useGravity = true;
               *                     GameManager.boxInstance.rigidbody.isKinematic = false;
               *             }
               *             else if (selectedBox == 1) {
               *                     GameManager.boxInstance2.rigidbody.useGravity = true;
               *                     GameManager.boxInstance2.rigidbody.isKinematic = false;
               *             }
               *             else if (selectedBox == 2){
               *                     GameManager.boxInstance3.rigidbody.useGravity = true;
               *                     GameManager.boxInstance3.rigidbody.isKinematic = false;
               *             }
               *             show = true;
               *             rotateMode = false;
               *             selectedBox = -1;
               *     }
               * }
               * if (moveMode) {
               *     Debug.Log ("MoveMODE");
               *     newPos = r_controller.Position;
               *     Vector3 pos = newPos - oldPos;
               *     pos = pos * 0.01f;
               *     Debug.Log ("Moving with " + pos);
               *     if(selectedBox == 0) {
               *             //Debug.Log (GameManager.select + " " + GameManager.select2 + " " + GameManager.select3);
               *             //GameManager.boxInstance.transform.Translate(new Vector3(0,3,0));
               *             Debug.Log ("1");
               *             GameManager.boxInstance.transform.Translate (pos,Space.World);
               *             //GameManager.boxInstance.transform.Translate(new Vector3(0,-3,0));
               *     }
               *     else if(selectedBox == 1){
               *             //GameManager.boxInstance2.transform.Translate(new Vector3(0,3,0));
               *             Debug.Log ("2");
               *             GameManager.boxInstance2.transform.Translate (pos,Space.World);
               *             //GameManager.boxInstance2.transform.Translate(new Vector3(0,-3,0));
               *     }
               *     else if(selectedBox == 2){
               *             //GameManager.boxInstance3.transform.Translate(new Vector3(0,3,0));
               *             Debug.Log ("3");
               *             GameManager.boxInstance3.transform.Translate (pos,Space.World);
               *             //GameManager.boxInstance3.transform.Translate(new Vector3(0,-3,0));
               *     }
               *     oldPos = newPos;
               *     if (l_controller.GetButtonDown (SixenseButtons.TWO)) {
               *             if (selectedBox == 0) {
               *                     GameManager.boxInstance.rigidbody.useGravity = true;
               *                     GameManager.boxInstance.rigidbody.isKinematic = false;
               *             }
               *             else if (selectedBox == 1) {
               *                     GameManager.boxInstance2.rigidbody.useGravity = true;
               *                     GameManager.boxInstance2.rigidbody.isKinematic = false;
               *             }
               *             else if (selectedBox == 2){
               *                     GameManager.boxInstance3.rigidbody.useGravity = true;
               *                     GameManager.boxInstance3.rigidbody.isKinematic = false;
               *             }
               *             show = true;
               *             moveMode = false;
               *             selectedBox = -1;
               *     }
               * }*/
     if (introShown)
     {
         if (GameManager.picked == 3)
         {
             if (introTime2 < 0.0f)
             {
                 introShown = false;
             }
             else
             {
                 introTime2 -= Time.deltaTime;
             }
         }
         else
         {
             if (introTime < 0.0f)
             {
                 introShown = false;
             }
             else
             {
                 introTime -= Time.deltaTime;
             }
         }
     }
 }
Exemplo n.º 13
0
 // Use this for initialization
 void Start()
 {
     kohakuController         = gameObject.GetComponent <UnityChanControlScriptWithRgidBody>();
     kohakuController.enabled = false;
     GameManager.I.OnGameStart.AddListener(OnGameStart);
 }
Exemplo n.º 14
0
 // Update is called once per frame
 private void Update()
 {
     t++;
     t = t % 50;
     if (controlScript == null) {
         GameObject unityChan = GameObject.Find ("Unity-Chan(Clone)/unitychan");
         controlScript = (UnityChanControlScriptWithRgidBody) unityChan.GetComponent("UnityChanControlScriptWithRgidBody");
     }
     rotx = Input.GetAxis ("Vertical");
     roty = Input.GetAxis ("Horizontal");
     if (Input.GetKeyDown(KeyCode.F) && !menu) {
         if(GameManager.select || GameManager.select2 || GameManager.select3) {
             if(GameManager.select) {
                 //Debug.Log (GameManager.select + " " + GameManager.select2 + " " + GameManager.select3);
                 //GameManager.boxInstance.audio.Play ();
                 this.transform.GetChild (2).audio.Play ();
                 GameManager.boxInstance.active = false;
             }
             else if(GameManager.select2) {
                 //GameManager.boxInstance2.audio.Play ();
                 this.transform.GetChild (2).audio.Play ();
                 GameManager.boxInstance2.active = false;
             }
             else if(GameManager.select3) {
                 //GameManager.boxInstance3.audio.Play ();
                 this.transform.GetChild (2).audio.Play ();
                 GameManager.boxInstance3.active = false;
             }
             show = false;
             sel = false;
             menu = false;
             controlScript.interacting = false;
             GameManager.picked += 1;
             introShown = true;
             introTime = 5.0f;
             introTime2 = 10.0f;
         } else if(GameManager.bossSelect) {
             menu = true;
             GameManager.samuraiInstance.audio.Play();
             bossShow = true;
         }
     }
     else if(Input.GetKeyDown (KeyCode.W) && menu) {
         if(show) {
             ind--;
             if(ind < 0)
                 ind = 1;
         } else if(bossShow) {
             bossInd--;
             if(bossInd < 0)
                 bossInd = 1;
         }
     } else if(Input.GetKeyDown (KeyCode.S) && menu) {
         if(show) {
             ind++;
             if(ind > 1)
                 ind = 0;
         } else if(bossShow) {
             bossInd++;
             if(bossInd > 1)
                 bossInd = 0;
         }
     } else if(Input.GetKeyDown (KeyCode.F) && menu) {
         if(show)
             sel = true;
         else if(bossShow && bossQualify)
             bossSel = true;
         else if(bossShow && !bossQualify) {
             bossShow = false;
             menu = false;
         }
     }/*
     if (rotateMode) {
         //Debug.Log ("ROTATEMODE");
         newRot = r_controller.Rotation;
         //Debug.Log ("Rotating with " + rotation);
         if(GameManager.select) {
             //Debug.Log (GameManager.select + " " + GameManager.select2 + " " + GameManager.select3);
             //GameManager.boxInstance.transform.Translate(new Vector3(0,3,0));
             GameManager.boxInstance.transform.rotation = newRot;
             //GameManager.boxInstance.transform.Translate(new Vector3(0,-3,0));
         }
         else if(GameManager.select2){
             //GameManager.boxInstance2.transform.Translate(new Vector3(0,3,0));
             GameManager.boxInstance2.transform.rotation = newRot;
             //GameManager.boxInstance2.transform.Translate(new Vector3(0,-3,0));
         }
         else if(GameManager.select3){
             //GameManager.boxInstance3.transform.Translate(new Vector3(0,3,0));
             GameManager.boxInstance3.transform.rotation = newRot;
             //GameManager.boxInstance3.transform.Translate(new Vector3(0,-3,0));
         }
         oldRot = newRot;
         if (l_controller.GetButtonDown (SixenseButtons.TWO)) {
             if (selectedBox == 0) {
                 GameManager.boxInstance.rigidbody.useGravity = true;
                 GameManager.boxInstance.rigidbody.isKinematic = false;
             }
             else if (selectedBox == 1) {
                 GameManager.boxInstance2.rigidbody.useGravity = true;
                 GameManager.boxInstance2.rigidbody.isKinematic = false;
             }
             else if (selectedBox == 2){
                 GameManager.boxInstance3.rigidbody.useGravity = true;
                 GameManager.boxInstance3.rigidbody.isKinematic = false;
             }
             show = true;
             rotateMode = false;
             selectedBox = -1;
         }
     }
     if (moveMode) {
         Debug.Log ("MoveMODE");
         newPos = r_controller.Position;
         Vector3 pos = newPos - oldPos;
         pos = pos * 0.01f;
         Debug.Log ("Moving with " + pos);
         if(selectedBox == 0) {
             //Debug.Log (GameManager.select + " " + GameManager.select2 + " " + GameManager.select3);
             //GameManager.boxInstance.transform.Translate(new Vector3(0,3,0));
             Debug.Log ("1");
             GameManager.boxInstance.transform.Translate (pos,Space.World);
             //GameManager.boxInstance.transform.Translate(new Vector3(0,-3,0));
         }
         else if(selectedBox == 1){
             //GameManager.boxInstance2.transform.Translate(new Vector3(0,3,0));
             Debug.Log ("2");
             GameManager.boxInstance2.transform.Translate (pos,Space.World);
             //GameManager.boxInstance2.transform.Translate(new Vector3(0,-3,0));
         }
         else if(selectedBox == 2){
             //GameManager.boxInstance3.transform.Translate(new Vector3(0,3,0));
             Debug.Log ("3");
             GameManager.boxInstance3.transform.Translate (pos,Space.World);
             //GameManager.boxInstance3.transform.Translate(new Vector3(0,-3,0));
         }
         oldPos = newPos;
         if (l_controller.GetButtonDown (SixenseButtons.TWO)) {
             if (selectedBox == 0) {
                 GameManager.boxInstance.rigidbody.useGravity = true;
                 GameManager.boxInstance.rigidbody.isKinematic = false;
             }
             else if (selectedBox == 1) {
                 GameManager.boxInstance2.rigidbody.useGravity = true;
                 GameManager.boxInstance2.rigidbody.isKinematic = false;
             }
             else if (selectedBox == 2){
                 GameManager.boxInstance3.rigidbody.useGravity = true;
                 GameManager.boxInstance3.rigidbody.isKinematic = false;
             }
             show = true;
             moveMode = false;
             selectedBox = -1;
         }
     }*/
     if(introShown) {
         if(GameManager.picked == 3) {
             if(introTime2 < 0.0f) {
                 introShown = false;
             } else {
                 introTime2 -= Time.deltaTime;
             }
         }
         else {
             if(introTime < 0.0f) {
                 introShown = false;
             } else {
                 introTime -= Time.deltaTime;
             }
         }
     }
 }