Esempio n. 1
0
    protected override void Awake()
    {
        base.Awake();
        Quaternion initRotation = transform.GetChild(0).rotation;

        scaffoldsTransform = transform.GetChild(0);
        scaffoldsTransform.gameObject.AddComponent <MovableObject>();
        movableObject = BaseMoveType.Create(scaffoldsTransform, moveType, controlPoints);

        foreach (Transform child in transform)
        {
            if (scaffoldsTransform != child)
            {
                Destroy(child.gameObject);
            }
        }

        scaffoldsTransform.parent = transform;

        if (useSounds.Count == 0)
        {
            useSounds.Add(SoundCollector.SoundName.Driving5);
        }

        //currentControlPointIndex = 0;
        //nextControlPointIndex = 0;

        // シーン開始時の状態
        if (playOnAwake)
        {
            // 開始時から起動している
            //SoundPlayerSingleton.instance.PlaySE(scaffoldsTransform.gameObject, soundCollector[useSounds[0]], true);
            switchState = true;
        }
        else
        {
            // デフォルトがオンなのでオフにするために呼ぶ
            MovableObject.Switch();
            switchState = false;
        }
    }
Esempio n. 2
0
    protected override void Awake()
    {
        base.Awake();
        // 操作するオブジェクトを取得
        controlObjectTransform = transform.GetChild(0);
        controlObjectTransform.gameObject.AddComponent <MovableObject>();
        movableObject = BaseMoveType.Create(controlObjectTransform, moveType, controlPoints);

        // 実行時、操作するオブジェクト以外の子を削除
        foreach (Transform child in transform)
        {
            if (controlObjectTransform != child)
            {
                Destroy(child.gameObject);
            }
        }

        controlObjectTransform.parent = transform;

        if (useSounds.Count == 0)
        {
            useSounds.Add(SoundCollector.SoundName.Driving5);
        }

        // シーン開始時の状態
        if (playOnAwake)
        {
            // 開始時から起動している
            switchState = true;
        }
        else
        {
            // デフォルトがオンなのでオフにするために呼ぶ
            movableObject.Switch();
            switchState = false;
        }
    }
Esempio n. 3
0
    protected override void Awake()
    {
        base.Awake();
        Quaternion initRotation = transform.GetChild(0).rotation;
        scaffoldsTransform = transform.GetChild(0);
        scaffoldsTransform.gameObject.AddComponent<MovableObject>();
        movableObject = BaseMoveType.Create(scaffoldsTransform, moveType, controlPoints);

        foreach (Transform child in transform)
        {
            if (scaffoldsTransform != child)
            {
                Destroy(child.gameObject);
            }
        }

        scaffoldsTransform.parent = transform;

        if (useSounds.Count == 0)
        {
            useSounds.Add(SoundCollector.SoundName.Driving5);
        }

        //currentControlPointIndex = 0;
        //nextControlPointIndex = 0;

        // シーン開始時の状態
        if (playOnAwake)
        {
            // 開始時から起動している
            //SoundPlayerSingleton.instance.PlaySE(scaffoldsTransform.gameObject, soundCollector[useSounds[0]], true);
            switchState = true;
        }
        else
        {
            // デフォルトがオンなのでオフにするために呼ぶ
            MovableObject.Switch();
            switchState = false;
        }
    }