Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (_timer >= _startTime - 1)
     {
         startView.SetActive(false);
         if (_timer >= _startTime)
         {
             startMessage.SetActive(false);
             isPlay = true;
             Debug.Log("START");
             _isTimerCount = false;
             _timer        = 0;
         }
     }
     if (_isTimerCount)
     {
         _timer += Time.deltaTime;
     }
     if (isPlay)
     {
         _gameTimer += Time.deltaTime;
     }
     _gameTime.text = "経過時間:" + _gameTimer.ToString("f1");
     if (isClear)
     {
         Debug.Log("CLEAR");
         scooreView.SetActive(true);
         _clearSource.Play();
         _gameTime2.text = _gameTimer.ToString("f1") + "秒";
         isPlay          = false;
         isClear         = false;
         DefineData.SetData(true, DefineData.SCENE_NAME.GAME_A);
     }
 }
Exemplo n.º 2
0
        private DefineData GetDefineParamInfo(String typeName)
        {
            var reflector = new Reflector( );

            var parts = typeName.Require( ).Split(',').Require( );
            var asm   = AppDomain.CurrentDomain.GetAssemblies( ).FirstOrDefault(a => a.GetName( ).Name.Equals(parts[1].Trim( ).Replace("/", ""), StringComparison.InvariantCultureIgnoreCase));

            if (asm != null)
            {
                var type = asm.GetType(parts[0].Trim( ), false, true);
                var data = new DefineData {
                    Name          = type.Name,
                    QualifiedName = type.QualifiedName( ),
                };

                if (type.Is <Enum> ( ))
                {
                    data.Fields.AddRange(reflector.GetEnumInfo(type));
                }
                else
                {
                    var props = type.GetProperties(BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.Public).Where(p => !p.HasAttribute <IgnoreAttribute> ( ));
                    foreach (var prop in props)
                    {
                        data.Properties.AddRange(reflector.GetPropertyInfo("", prop));
                    }
                }
                return(data);
            }
            return(null);
        }
Exemplo n.º 3
0
    private void Init()
    {
        if (!File.Exists(TEMPLETE_PATH))
        {
            FileStream fm = File.Create(TEMPLETE_PATH);
            fm.Close();
            AssetDatabase.Refresh();
        }
        string[] tAllLines = File.ReadAllLines(TEMPLETE_PATH);

        mDefineList = new DefineData[tAllLines.Length];

        int tIndex = 0;

        foreach (string tLine in tAllLines)
        {
            string[] tSplitLine = tLine.Split(new string[] { "//" }, StringSplitOptions.None);
            mDefineList[tIndex]        = new DefineData();
            mDefineList[tIndex].define = tSplitLine[0];
            if (1 < tSplitLine.Length)
            {
                mDefineList[tIndex].comment = tSplitLine[1];
            }
            if (2 < tSplitLine.Length)
            {
                mDefineList[tIndex].category = tSplitLine[2];
            }
            tIndex++;
        }


        Array.Sort <DefineData>(mDefineList, (x, y) => {
            int tRet;
            if (null != x.category && null != y.category)
            {
                tRet = x.category.CompareTo(y.category);
                if (0 != tRet)
                {
                    return(tRet);
                }
            }
            else if (null != x.category && null == y.category)
            {
                return(-1);
            }
            else if (null == x.category && null != y.category)
            {
                return(1);
            }

            return(-x.define.CompareTo(y.define));
        });
    }
Exemplo n.º 4
0
    void Awake()
    {
        // アセットの参照受け取り
        playerData = Resources.Load <PlayerData>("Assets/PlayerData");
        defineData = Resources.Load <DefineData>("Assets/DefineData");

        // ゲームオブジェクトの参照受け取り
        sceneObj = FindObjectOfType <GameMainSceneController>();
        childObjCreatePointObj = FindObjectOfType <ChildObjCreatePoint>();

        // プレハブの読み込み
//		prefabAttackObj = (GameObject)Resources.Load("Prefabs/GameMain/AttackObj");

        // パーティクルオブジェ取得
        foreach (Transform child in transform)
        {
            if (child.name == "AttackWater")
            {
                attackWaterObj = child.GetComponent <ParticleSystem>();
            }
        }

        // プレイヤーアイコンオブジェの取得
        numIconObj = this.transform.FindChild("Player_NumIcon");
        numIconPos = numIconObj.localPosition;

        // ボタン文字列に自分のIDを追加
        horizontalStr += this.name;
        verticalStr   += this.name;
        upStr         += this.name;
        attackStr     += this.name;

        // 移動限界値の設定
        max = defineData.STAGE_BOARDER_SIZE / 2.0f;
        min = -(defineData.STAGE_BOARDER_SIZE / 2.0f);

        // rootの参照を取得
        foreach (Transform child in transform)
        {
            if (child.name == "root")
            {
                rootObj = child.gameObject;
            }
        }

        // リジッドボディの取得
        rigidbody = GetComponent <Rigidbody>();

        // レンダラーコンポーネントの取得
        rendererObj = GetComponent <MeshRenderer>();
    }
Exemplo n.º 5
0
        // Start is called before the first frame update
        void Start()
        {
            _nowPhase           = SYNC_PHASE.Idling;
            DefineData.userName = "******";

            StartSync();

            this.UpdateAsObservable()
            .Where(_ => userName.Count > 0)
            .Subscribe(_ => {
                var uName         = userName.Dequeue();
                userNameText.text = uName;
                DefineData.SetUserName(uName);
            });
        }
Exemplo n.º 6
0
        bool CheckLongOption(string OptionText)
        {
            string Key = OptionText.Substring(2);

            ParseArgument = null;
            ParseOption   = null;
            foreach (DefineData o in DefineList)
            {
                if (o.Long != null && Key.StartsWith(o.Long))
                {
                    ParseOption   = o;
                    ParseArgument = Key.Substring(o.Long.Length);
                    return(true);
                }
            }
            Console.WriteLine("Invalid Option:{0}", OptionText);
            return(false);
        }
Exemplo n.º 7
0
 void ScoreUi()
 {
     _clickSource.Play();
     Debug.Log("HOGEHOGE");
     DefineData.SetData(true, DefineData.SCENE_NAME.GAME_D);
 }
 public static void DeleteDefine(DefineData define)
 {
     m_instance.m_defineList.Remove(define);
 }
Exemplo n.º 9
0
 void Awake()
 {
     defineData = Resources.Load <DefineData>("Assets/DefineData");
 }
Exemplo n.º 10
0
 private void FinalOk()
 {
     DefineData.SetData(true, DefineData.SCENE_NAME.GAME_B);
 }