unity&C#初心者です。エラーが出てどこがおかしいのかわかりません。教えてください。
エラーは一番最後の空白のところ(79,9)となっていますがどういうことなのでしょうか?
using UnityEngine;
using System.Collections;
public class PlayerSCR : MonoBehaviour {
public bool moveFlag; public bool sceneJumpFlag = false; // Use this for initialization void Start () { iTween.Init (gameObject); } // Update is called once per frame void Update () { Move (); } void Move() { if (moveFlag) return; Vector2 move; move.x = Input.GetAxisRaw ("Horizontal"); move.y = Input.GetAxisRaw ("Vertical") ; if( Input.GetKey( "x" ) ) { Debug.Log( "Input X Key" ); if (move.x != 0 && move.y != 0) { HitCheck(move); SetMove(move); } } else { if (move.x != 0 || move.y != 0) { HitCheck(move); SetMove(move); } } } void HitCheck (Vector2 move){ RaycastHit2D hit = new RaycastHit2D (); Vector2 tmpStartPoint = this.gameObject.transform.position; Vector2 tmpDirection = move; float tmpRange = Mathf.Sqrt (Mathf.Abs (move.x) + Mathf.Abs (move.y)); hit = Physics2D.Raycast (tmpStartPoint, tmpDirection, tmpRange); if (hit) { if (hit.transform.gameObject.name == "Floor_Step") { sceneJumpFlag = true; } } } void SetMove( Vector2 move ) { Vector3 targetPos = new Vector3 (gameObject.transform.position.x + move.x, gameObject.transform.position.y + move.y, 0.0f); Hashtable hash = new Hashtable(); hash.Add( "position", targetPos ); hash.Add( "time", 0.5f ); hash.Add( "oncomplete", "OnCompleteCallback"); hash.Add( "oncompleteparams", "MoveComplete"); hash.Add( "oncompletetarget", gameObject ); iTween.MoveTo (gameObject, hash ); moveFlag = true; } // iTween Complete void OnCompleteCallback( string message ){ moveFlag = false; Debug.Log( message ); if (sceneJumpFlag) { switch (Application.loadedLevelName) { case "_town": Application.LoadLevel ("_dungeon"); break; case "_dungeon": Application.LoadLevel ("_town"); break; } } }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2014/12/14 11:36
2015/02/12 01:14