示例#1
0
 private void Start()
 {
     c_state       = GetComponent <CrystalState>();
     c_state.state = C_STATE.EMPTY;
     stairs        = new GameObject[4];
     for (int i = 0; i < 4; i++)
     {
         stairs[i] = transform.GetChild(i).gameObject;
     }
 }
示例#2
0
 // 接続開始
 private void StartConnection()
 {
     // 状態を変更
     state = CrystalState.Connecting;
     // アクションを非表示
     helper.ActionHidden();
     // ゲージを表示
     gauge.gameObject.SetActive(true);
     // チャージの効果音を鳴らす
     effectSound_source.PlayOneShot(chargeSound);
     // チャージのエフェクトを開始
     chargeEffect.Play();
 }
示例#3
0
 private void OnTriggerEnter(Collider other)
 {
     // 接続完了後は何もできない
     if (state == CrystalState.Connected)
     {
         return;
     }
     // プレイヤーが触れた時
     if (other.gameObject.CompareTag("Player"))
     {
         // フラグを立てる
         state = CrystalState.Ready;
         // アクションボタンの内容を表示
         helper.ActionDisplay("接続");
     }
 }
示例#4
0
 // 接続成功
 private void SuccessConnection()
 {
     // 状態を変更
     state = CrystalState.Connected;
     // チャージのエフェクトを消す
     StopChargeEffect();
     // キラキラのエフェクトを表示
     connectedEffect.Play();
     // クリスタルを光らせる
     mat.DOFloat(2f, "_EnvironmentLight", 2f);
     mat.DOFloat(2f, "_Emission", 2f);
     // クリスタルの環境音を変える
     environment_source.clip = connectedSound;
     environment_source.Play();
     // 接続成功の効果音を鳴らす
     effectSound_source.PlayOneShot(connectionSound);
     // 管理クラスでの処理
     manager.ConnectCrystal(crystalColor);
 }
示例#5
0
    private void Start()
    {
        RotY          = 0;
        state         = STATE.stop;
        c_state       = GetComponent <CrystalState>();
        c_state.state = C_STATE.EMPTY;

        parent     = transform.parent;
        movingTime = 1;
        myTime     = 0;

        //왼쪽 오른쪽 최대 지점을 정하고 구간계산
        if ((maxLimit + (-minLimit)) % stopPointDistance == 0)
        {
            stopPointCount = ((maxLimit + (-minLimit)) / stopPointDistance) + 1; //0때문에 1더함
            stopPoint      = new int[stopPointCount];
            int section = (maxLimit + (-minLimit)) / (stopPointCount - 1);
            for (int i = 0; i < stopPointCount; i++)
            {
                stopPoint[i] = (section * i) + minLimit;
                if (stopPoint[i] == 0)
                {
                    myPoint   = i;
                    zeroPoint = i;
                }
            }
        }
        else
        {
            Debug.Log("Stop Point Error");
            stopPoint = null;
        }

        if (transform.parent == null)
        {
            Debug.Log("parent not find");
        }

        if (minLimit >= maxLimit)
        {
            Debug.Log("Limit Error");
        }
    }
示例#6
0
    private void OnTriggerExit(Collider other)
    {
        // 接続間呂後は何もできない
        if (state == CrystalState.Connected)
        {
            return;
        }

        // 離れた時
        if (other.gameObject.CompareTag("Player"))
        {
            // 接続中の時はキャンセル処理
            if (state == CrystalState.Connecting)
            {
                CancelConnection();
            }
            // フラグを下げる
            state = CrystalState.Nothing;
            // アクションボタンを非表示
            helper.ActionHidden();
        }
    }
示例#7
0
        /// <summary>
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param>
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);
            switch (state)
            {
            case CrystalState.Exist:
                state     = CrystalState.NotExists;
                BackColor = Color.Green;
                break;

            case CrystalState.NotExists:
                state     = CrystalState.Undefined;
                BackColor = SystemColors.Control;
                break;

            case CrystalState.Undefined:
                state     = CrystalState.Exist;
                BackColor = Color.Red;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }