Inheritance: MonoBehaviour
Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        // get player reference
        player = GameObject.FindGameObjectWithTag("player").GetComponent <PlayerScript>();
        // get generator component
        generator = GetComponent <ObstacleGenerator>();        // assumes the component is on this gameobject
        // get wheel reference
        wheel = GameObject.FindGameObjectWithTag("Roller").GetComponent <BigRoller>();
        // get level select ref
        levelSelect = GetComponent <LevelSelect>();
        // get UI ref
        UI = GetComponent <GameplayUI>();
        // get actual player angle
        player.posOnWheel = Vector3.Angle(Vector3.up, player.transform.position - wheel.transform.position);

        currentLifeStage = 0;

        stressDistance = maxDistance;

        AudioController = GameObject.Find("Global").GetComponent <AudioControl>();

        // Audio test stuff
        //bassTrack.clip = Bass;
        //melodyTrack.clip = Melody;
    }
Beispiel #2
0
        public OptionsMenu()
        {
            SetSize = MinSize = (800, 450);
            IoCManager.InjectDependencies(this);

            Title = Loc.GetString("ui-options-title");

            GraphicsControl  graphicsControl;
            KeyRebindControl rebindControl;
            AudioControl     audioControl;

            var tabs = new TabContainer
            {
                Children =
                {
                    (graphicsControl = new GraphicsControl(_configManager)),
                    (rebindControl   = new KeyRebindControl()),
                    (audioControl    = new AudioControl(_configManager,     _clydeAudio)),
                }
            };

            TabContainer.SetTabTitle(graphicsControl, Loc.GetString("ui-options-tab-graphics"));
            TabContainer.SetTabTitle(rebindControl, Loc.GetString("ui-options-tab-controls"));
            TabContainer.SetTabTitle(audioControl, Loc.GetString("ui-options-tab-audio"));

            Contents.AddChild(tabs);
        }
Beispiel #3
0
 void Start()
 {
     m_Animator   = gameObject.GetComponent <Animator>();
     m_collider   = gameObject.GetComponent <CapsuleCollider2D>();
     isDieID      = Animator.StringToHash("isDie");
     soundControl = GameObject.Find("AudioControl").GetComponent <AudioControl>();
 }
Beispiel #4
0
    public void BuyButton()
    {
        AudioControl.DPlaySound("Click 1");
        if (VariableSystem.diamond >= price && price != 0)
        {
            VariableSystem.AddDiamond(-price);
            GoogleAnalytics.instance.LogScreen("Buy ShopItem: " + vi_detail[IdItem - 1]);
            gridView.FindChild("" + IdItem).GetComponent <ItemShop>().Price = price;
            gridView.FindChild("" + IdItem).GetComponent <ItemShop>().SetBuy();

            Transform diamond = Instantiate(SubDiamond) as Transform;
            diamond.parent     = this.transform;
            diamond.position   = btBuy.position;
            diamond.localScale = new Vector3(1, 1, 1);
            diamond.FindChild("Count").GetComponent <UILabel>().text = "-" + price;
            LeanTween.moveLocalY(diamond.gameObject, diamond.position.y - 300, 0.5f).setEase(LeanTweenType.easeOutSine).setOnComplete(delegate()
            {
                Destroy(diamond.gameObject);
            });
        }
        else
        {
            Debug.Log("Thieu tien roi");
            DialogInapp.ShowInapp();
        }
    }
Beispiel #5
0
    // 岩生成
    void generateRock( )
    {
        GameObject[] rock_num = GameObject.FindGameObjectsWithTag("Rock");
        AudioControl se1      = Audio.GetComponent <AudioControl>( );

        if (Input.GetButtonDown("X") && !inputcut && !jump && _rock && !gen_wait)
        {
            if (rock_num.Length < GENROCK_COUNT)
            {
                generate = true;
                inputcut = true;
                gen_wait = true;
            }
        }

        // 生成アニメーション待ちして生成
        if (generate && duration >= 1.0f && anim_nomalized_time >= 0.5f)
        {
            se1.Playse("Generate");
            GameObject rock = (GameObject)Resources.Load("Prefab/Rock");
            Instantiate(rock, transform.position + transform.right * -2.0f, Quaternion.identity);

            generate = false;
            inputcut = false;
        }
    }
Beispiel #6
0
    void Start()
    {
        audioControl  = GameObject.Find("AudioControl").GetComponent <AudioControl>();
        animator      = GetComponent <Animator>();
        labelTop.text = TownScenesController.languageTowns["MAKET"];
        //IDAllowViewProductInMarket = new List<int> ();
        // IDAllowViewProductInMarket.Clear();
        // SetListProductOfMission();

        listProductInformation = new List <ProductInfomation>();
        listProductInformation.Clear();
        if (FactoryScenesController.isCreat)
        {
            listProductInformation = FactoryScenesController.listProductInformation;
        }
        else
        {
            ReadProductInfor();
        }
        if (listSpriteProduct == null)
        {
            listSpriteProduct = Resources.LoadAll <Texture>("Factory/Button/Images/Product");
        }
        CreatButtonProduct(MissionData.townDataMission.itemsInShop); //cái này mới đúng, sau này dùng
        // CreatButtonProduct(IDAllowViewProductInMarket);
    }
    void Start()
    {
        labelOther[0].text = TownScenesController.languageTowns["CONGRATULATIONS"];
        labelOther[1].text = TownScenesController.languageTowns["MaketResearchResult"];
        #region for test
        //precisionMax = 80;
        //precisionMin = 60;
        // MissionData.READ_XML(4);
        #endregion
        audioControl = GameObject.Find("AudioControl").GetComponent <AudioControl>();

        if (listSpriteProduct == null)
        {
            listSpriteProduct = Resources.LoadAll <Texture>("Factory/Button/Images/Product");
        }

        IDAllowViewProduct = new List <int>();
        IDAllowViewProduct.Clear();
        SetListProductAllow();

        listProductInfor = new List <ProductInforMaketResearchResult>();
        listProductInfor.Clear();
        SetPercentProduct();

        SetVisibleGridItem();
        CreatItemProduct();
        ControlViewHelp();
    }
 void Start()
 {
     audioControl  = GameObject.Find("AudioControl").GetComponent <AudioControl>();
     animator      = GetComponent <Animator>();
     label[0].text = TownScenesController.languageTowns["CONGRATULATIONS"];
     label[1].text = SetResult();
 }
        private void Update()
        {
            UpdateVolume();
            float per_hp = (float)Math.Round(1.0f * GameControl.gameData.currentHP / GameControl.gameData.maxHP, 2);

            if (HPVolume.transform.localScale.x != per_hp)
            {
                HPVolume.transform.SetScaleX(Mathf.Lerp(HPVolume.transform.localScale.x, per_hp, Time.deltaTime * 4));
                if (Mathf.Abs(per_hp - HPVolume.transform.localScale.x) <= 0.01)
                {
                    HPVolume.transform.SetScaleX(per_hp);
                }
            }

            if (GameControl.gameData.currentHP != lastHP)
            {
                lastHP = GameControl.gameData.currentHP;
                CheckPlayerDie();
            }
            if (GameControl.gameData.BOSS_die)
            {
                GameDef.isFight = true;
                AudioControl.PlayEffect(GameDef.winEffect, 0.5f);
                UIAPI.ShowMsgBox("胜利", "成功击败BOSS,即将退出冒险世界", "确定", delegate(object arg) {
                    Settlement(2);
                });
                GameControl.gameData.BOSS_die = false;
            }
        }
    public static void ConsumeCube(CubeData cube)
    {
        Vector2 _pos;

        if (cube.color == instance.lastCube.color)
        {
            instance.multiplier++;
            _pos = Camera.main.WorldToScreenPoint(cube.objTrans.position);
            MultiplierControl.ShowMultiplier(cube.color, instance.multiplier, _pos);
            AudioControl.PlayFX("multiplier");
        }
        else
        {
            instance.multiplier = 1;
        }
        instance.lastCube = cube;

        instance.points += cube.points * instance.multiplier;
        instance.StartCoroutine(instance.destroyCube(cube));
        ScoreControl.Set(instance.points);
        if ((state == PLAYING) && (SpawnManager.RemainCubes() == 0))
        {
            state = SUCCESS;
            TitleControl.Animate("GOOD JOB!", TitleControl.SUCCESS_ANIM);
            instance.nextUpdate = Time.time + 2;
        }
    }
Beispiel #11
0
 public void SettingButton()
 {
     AudioControl.DPlaySound("Click 1");
     dialogLoading.GetComponent <DialogLoading>().ShowLoading(false);
     dialogSetting.gameObject.SetActive(true);
     dialogSetting.gameObject.GetComponent <DialogSetting>().ShowDialogSetting();
 }
    ///Ação do botão de Aleatório
    public void RandomBT()
    {
        if (controller.getSelectionState() != GameSelection.READY)
        {
            switch (controller.getSelectionState())
            {
            case GameSelection.P1_CONFIRM:
                indexP1 = -1;
                break;

            case GameSelection.P2_CONFIRM:
                indexP2 = -1;
                break;

            case GameSelection.READY:
                break;

            default:
                break;
            }
            controller.NullConfirm();
            AudioControl.GetInstance().PlaySoundEffect(urna, 0.6f);
            SelectButtonsForIndexs();
            ConfirmButtonForControllerState(controller.getSelectionState());
        }
    }
Beispiel #13
0
    private void dead( )
    {
        _isdead     = true;
        sound_span -= Time.deltaTime;         //タイマーのカウントダウン
        if (sound_span <= 0)
        {
            AudioControl se = Audio.GetComponent <AudioControl>();
            se.Playse("敵にあてた");
            sound_span = 3.0f;
        }

        if (_isdead && duration >= 2.0f)
        {
            rb2d.bodyType = RigidbodyType2D.Kinematic;
            GetComponent <PolygonCollider2D>( ).enabled = false;
        }

        if (_isdead && duration >= 2.5f && anim_nomalized_time >= 0.45f)
        {
            fade_time -= Time.deltaTime;

            if (fade_time > 0)
            {
                alpha    = fade_time / FADE_TIME;
                color    = sr.color;
                color.a  = alpha;
                sr.color = color;
            }
            if (fade_time < 0)
            {
                Destroy(gameObject);
            }
        }
    }
Beispiel #14
0
 public void OnBtnUplevel()
 {
     AudioControl.PlayEffect(GameDef.clickEffect);
     costCoin  = (uint)skill.costCoin[level - 1];
     costOCoin = (uint)skill.costOCoin[level - 1];
     UIAPI.ShowMsgBox("技能升级", "是否花费" + costCoin + "金币和" + costOCoin + "灵石升级" + skill.skillName, "确定|取消", UpLevel);
 }
 void Start()
 {
     audio = GetComponent<AudioSource> ();
     control = GameObject.Find ("Audio").GetComponent<AudioControl>();
     targetVolume = audio.volume;
     controlVolume = 100;
 }
Beispiel #16
0
        public OptionsMenu()
        {
            IoCManager.InjectDependencies(this);

            Title = Loc.GetString("Game Options");

            GraphicsControl  graphicsControl;
            KeyRebindControl rebindControl;
            AudioControl     audioControl;

            var tabs = new TabContainer
            {
                Children =
                {
                    (graphicsControl = new GraphicsControl(_configManager)),
                    (rebindControl   = new KeyRebindControl()),
                    (audioControl    = new AudioControl(_configManager)),
                }
            };

            TabContainer.SetTabTitle(graphicsControl, Loc.GetString("Graphics"));
            TabContainer.SetTabTitle(rebindControl, Loc.GetString("Controls"));
            TabContainer.SetTabTitle(audioControl, Loc.GetString("Audio"));

            Contents.AddChild(tabs);
        }
Beispiel #17
0
 // Use this for initialization
 void Start()
 {
     Levels = new Dictionary <string, int>();
     Levels.Add("MainMenu", 0); Levels.Add("Main Menu", 0);
     Levels.Add("Game", 1); Levels.Add("Default", 1);
     AudioController = GameObject.Find("Global").GetComponent <AudioControl>();
 }
Beispiel #18
0
        public void OnBtnGain()
        {
            if (btnEnable)
            {
                AudioControl.PlayEffect(GameDef.clickEffect);
                var ud = AppConfig.Value.mainUserData;
                ud.coins  += uint.Parse(awardCoin.text);
                ud.ocoins += uint.Parse(awardOCoin.text);

                btnEnable = false;
                if (taskType == 0)
                {
                    if (++ud.growthTask[taskSub] == 3)//如果三阶成长任务完成,则显示已完成
                    {
                        gain.sprite = gainSprite[2];
                    }
                    else
                    {
                        gain.sprite = gainSprite[0];
                        AppConfig.Value.mainUserData = ud;
                        SetGrowthTask();
                    }
                }
                else if (taskType == 1)
                {
                    ud.dailyTask[taskSub].isGain = true;
                    gain.sprite = gainSprite[2];
                }

                AppConfig.Value.mainUserData = ud;
                AppConfig.Save();
            }
        }
Beispiel #19
0
    public static void SaveMissionDataCache(bool submitToServer = false)
    {
        string dataSave       = "";
        string dataSendServer = "";

        for (int i = 0; i < dataMissionCache.Length; i++)
        {
            dataSave += dataMissionCache[i].Mission + "-" + dataMissionCache[i].Score + "-" + dataMissionCache[i].Star + "-" + dataMissionCache[i].Open + ",";
            //Chi gui nhung mission da open len server
            if (dataMissionCache[i].Open == 1)
            {
                if (dataSendServer.Length > 0)
                {
                    dataSendServer += ",";
                }
                dataSendServer += dataMissionCache[i].Mission + "-" + dataMissionCache[i].Score + "-" + dataMissionCache[i].Star + "-" + dataMissionCache[i].Open;
            }
        }
        Debug.Log("Data save " + dataSave);
        PlayerPrefs.SetString(Mission_data_key, dataSave);
        if (submitToServer)
        {
            Debug.Log("Data send server  " + dataSendServer);
            AudioControl.getMonoBehaviour().StartCoroutine(DHS.PostMeInfoMissionUpdate(FB.UserId, dataSendServer));
        }
    }
Beispiel #20
0
 private void Start()
 {
     PhotonNetwork.ConnectUsingSettings("1.0");
     DeckHandler.LoadFromSaveToDeck();
     _audioControl = GameObject.FindGameObjectWithTag(Tag.Audio).GetComponent <AudioControl>();
     ButtonCheck();
 }
 void Awake()
 {
     instance         = this;
     arf              = GetComponent <AudioReverbFilter> ();
     arf.reverbPreset = AudioReverbPreset.Off;
     asrc             = GetComponent <AudioSource> ();
 }
Beispiel #22
0
        /// <summary>
        /// Initialization when window is poped up. Read all setting values, store all values as original, draw all graphs.
        /// </summary>
        public Configuration(AudioControl audio, Wale.Configuration.General cf)
        {
            InitializeComponent();

            this.CDL         = new ConfigDatalink();
            this.DataContext = this.CDL;
            this.CF          = cf;

            MainGrid.Children.Clear();

            MainGrid.Children.Add(new TitleBar(this));

            ConfigSet cs = new ConfigSet(audio, cf, this, false, true)
            {
                //cs.LogInvokedEvent += Cs_LogInvokedEvent;
                Margin = new Thickness(0, 35, 0, 0)
            };

            //cs.SizeChanged += ConfigSet_SizeChanged;
            CF.PropertyChanged += Default_PropertyChanged;
            MainGrid.Children.Add(cs);
            this.Height = (CF.AdvancedView ? Wale.Configuration.Visual.ConfigSetLongHeight : Wale.Configuration.Visual.ConfigSetHeight) + Wale.Configuration.Visual.TitleBarHeight;
            //this.Width = 280;

            this.Title = "Wale " + Localization.Interpreter.Current.Configuration;
        }
Beispiel #23
0
 public void BallAttackBtn()
 {
     if (isStart == false && p_attack == true)
     {
         p_attack          = false;
         btnAddATC.enabled = false;
         btnAddDEF.enabled = false;
         if (p_skill_enabel[3])
         {
             AudioControl.PlayEffect(GameDef.beheadEffect);
             StartCoroutine(MonsDefanse(GameDef.AttackAnimationClip3));
             if (p_skill_enabel[2])
             {
                 cool_time[2]            = 0;
                 skillMask[2].fillAmount = 0;
             }
         }
         else
         {
             StartCoroutine(MonsDefanse(GameDef.AttackAnimationClip2));
         }
         pFrame.SetActive(false);
         playerPanel.transform.SetScaleXYZ(0.95f, 0.95f, 0.95f);
     }
 }
Beispiel #24
0
    public void OnStartButtonClicked1( )
    {
        AudioControl se = Audio.GetComponent <AudioControl>( );

        se.Playse("決定");
        SceneNavigator.Instance.Change(gm._current_scene, 1.5f);
    }
Beispiel #25
0
    public void OnStartButtonClicked2( )
    {
        AudioControl se = Audio.GetComponent <AudioControl>( );

        se.Playse("決定");
        SceneNavigator.Instance.Change("thanks", 1.5f);
    }
Beispiel #26
0
        private void Awake()
        {
            _absoluteToggle.onValueChanged.AddListener(OnAbsoluteButtonClicked);
            _referenceToggle.onValueChanged.AddListener(OnReferenceButtonClicked);

            _audioControl = AudioControl.Instance;
        }
 // Use this for initialization
 void Start()
 {
     animator     = GetComponent <Animator>();
     gameControl  = GameObject.FindObjectOfType <GameControl>();
     audioControl = GameObject.FindObjectOfType <AudioControl>();
     FacePosition = PlayerFacePosition.up;
 }
 void Start()
 {
     audioControl        = GameObject.Find("AudioControl").GetComponent <AudioControl>();
     labelInfor[9].text  = TownScenesController.languageTowns["Upgrade"];
     labelInfor[10].text = TownScenesController.languageTowns["TECHNOGY"];
     ControlViewHelp();
 }
 void Start()
 {
     audioSource   = GetComponent <AudioSource>();
     control       = GameObject.Find("Audio").GetComponent <AudioControl>();
     targetVolume  = audioSource.volume;
     controlVolume = 100;
 }
Beispiel #30
0
 public void DeleteItemButton(Facebook.FacebookDelegate callback = null)
 {
     if (callback == null)
     {
         callback = result =>
         {
             if (!String.IsNullOrEmpty(result.Error))
             {
                 Debug.LogError(result.Error);
             }
             else
             {
                 //Cong tim khi nguoi dung nhan
                 AudioControl.AddHeart(1);
                 if (this != null)
                 {
                     Transform gridView = this.transform.parent;//This => Grid
                     gridView.GetComponent <UIGrid>().RemoveChild(this.transform);
                     Destroy(this.gameObject);
                 }
             }
         };
     }
     //Delete Request && Item
     if (requestId.Length > 0)
     {
         DFB.FBDeleteRequest(requestId, callback);
     }
     else
     {
         Debug.LogError("Request id not valid: " + requestId);
     }
 }
    private void UpdateUI()
    {
        for (int i = 0; i < audioControls.Length; i++)
        {
            AudioControl audioControl = audioControls[i];
            if (audioControl.audioClip != null)
            {
                switch (audioControl.audioStatus)
                {
                case AudioStatus.Ready:
                    audioControl.playButton.interactable  = true;
                    audioControl.pauseButton.interactable = false;
                    audioControl.stopButton.interactable  = false;
                    audioControl.pausedStatusTxt.enabled  = false;
                    break;

                case AudioStatus.Playing:
                    audioControl.playButton.interactable  = false;
                    audioControl.pauseButton.interactable = true;
                    audioControl.stopButton.interactable  = true;
                    audioControl.pausedStatusTxt.enabled  = false;
                    break;

                case AudioStatus.Paused:
                    audioControl.playButton.interactable  = true;
                    audioControl.pauseButton.interactable = false;
                    audioControl.stopButton.interactable  = false;
                    audioControl.pausedStatusTxt.enabled  = true;
                    break;
                }
            }
        }
    }
Beispiel #32
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
 // Use this for initialization
 void Start()
 {
     timeToTrigger = 0.5f;
     lm = GameObject.FindGameObjectWithTag("LevelManager");
     _ac = GameObject.FindGameObjectWithTag("AudioManager").GetComponent<AudioControl>();
     lmScript = lm.GetComponent<LevelManagement>();
     //Needed for collider detection
     if (lmScript.TriggerByCollider)
     {
         _cc = TriggerCollider.GetComponent<CollisionController>();
     }
     //Needed for Has been seen detection
     _renderer = this.gameObject.GetComponent<Renderer>();
 }
    // Use this for initialization
    void Start()
    {
        blackscreen.SetActive(false);
        Time.timeScale = 1;
        Cursor.visible = false;
        objectiveText.text = "Find the main entrance";
        RenderSettings.ambientIntensity = 0.2f;
        _ac = GameObject.FindGameObjectWithTag("AudioManager").GetComponent<AudioControl>();
        _enemy = GameObject.FindGameObjectWithTag("Enemy").GetComponent<EnemyController>();
        _LightControl = this.gameObject.GetComponent<LightController>();
        _triggerZoneManagement = this.gameObject.GetComponent<EyeRayCaster>();

        _key = false;
        FiredEvents = 0;
        FiredKeyEvents = 0;
    }
Beispiel #35
0
        public TimerForm()
        {
            InitializeComponent();

            panel1.BackColor = textBox1.BackColor = Color.FromArgb(30, 30, 30);

            this.icon = new CounterIcon(this.notifyIcon1);
            this.icon.Tick += icon_Tick;
            this.icon.Elapsed += icon_Elapsed;

            this.player = new AudioControl<string>(x => x);

            this.Load+=TimerForm_Load;
            hotkeys = new List<GlobalHotkey>();
            hotkeys.Add(new GlobalHotkey("Next", Constants.ALT + Constants.CTRL, Keys.A, this));

            this.Disposed += (s, e) => { icon.Dispose(); player.Dispose(); };
        }
Beispiel #36
0
    void Awake()
    {
        ac = GetComponent<AudioControl>();

        ammo = maxAmmo;
        clipSize = maxClipSize;
    }
    // Use this for initialization
    void Start()
    {
        // get player reference
        player = GameObject.FindGameObjectWithTag("player").GetComponent<PlayerScript>();
        // get generator component
        generator = GetComponent<ObstacleGenerator>(); // assumes the component is on this gameobject
        // get wheel reference
        wheel = GameObject.FindGameObjectWithTag("Roller").GetComponent<BigRoller>();
        // get level select ref
        levelSelect = GetComponent<LevelSelect>();
        // get UI ref
        UI = GetComponent<GameplayUI>();
        // get actual player angle
        player.posOnWheel = Vector3.Angle(Vector3.up, player.transform.position - wheel.transform.position);

        currentLifeStage = 0;

        stressDistance = maxDistance;

        AudioController = GameObject.Find("Global").GetComponent<AudioControl>();

        // Audio test stuff
        //bassTrack.clip = Bass;
        //melodyTrack.clip = Melody;
    }
 void Start()
 {
     _ac = GameObject.FindGameObjectWithTag("AudioManager").GetComponent<AudioControl>();
     _Player = GameObject.FindGameObjectWithTag("Player");
 }
Beispiel #39
0
 //    bool cursorVisible = true;
 void Start()
 {
     Time.timeScale = 1;
     pauseObjects = GameObject.FindGameObjectsWithTag("ShowOnPause");
     eventSystem = GameObject.Find ("EventSystem").GetComponent<EventSystem> ();
     input = GameObject.Find ("InputManager").GetComponent<InputManager> ();
     control = GameObject.Find ("Audio").GetComponent<AudioControl>();
     HidePaused();
 }
 //GameObject pointLight;
 //float timeForBlink;
 // Use this for initialization
 void Start()
 {
     _lightsources = GameObject.FindGameObjectsWithTag("LightSource");
     _ac = GameObject.FindGameObjectWithTag("AudioManager").GetComponent<AudioControl>();
 }
Beispiel #41
0
 public static AudioControl getInstance()
 {
     if(instance == null)
         instance = (AudioControl)FindObjectOfType(typeof(AudioControl));
     return instance;
 }
Beispiel #42
0
 void Awake()
 {
     anim = GetComponent<OTAnimation>();
     sprite = GetComponent<OTAnimatingSprite>();
     unit = GetComponent<Unit>();
     cc = GetComponent<CharacterController>();
     ac = GetComponent<AudioControl>();
 }
    // Use this for initialization
    void Start()
    {
        InitialPupilSize = 0.0f;

        System.IO.FileStream x = System.IO.File.Create(Application.dataPath + "/Data/Triggers/" + FileName1 + ".txt");
        System.IO.FileStream y = System.IO.File.Create(Application.dataPath + "/Data/Triggers/" + FileName2 + ".txt");

        x.Close();
        y.Close();

        Cursor.visible = false;

        _ac = GameObject.FindGameObjectWithTag("AudioManager").GetComponent<AudioControl>();

        Screen = black.GetComponent<Image>();

        if (BlackScreen)
        {
            //According the tests cyan was the mmost stabile
            Screen.color = Color.cyan;
        }
        else if (WhiteScreen)
        {
            Screen.color = Color.white;
        }
        else if(ColorSwitchScreen)
        {
            StartCoroutine(SwitchColorsOnScreen());
        }
        else
        {
            throw new Exception("No game mode was chosen on the Blackscream Script");
        }

        //Start data gathering
        StartCoroutine(MeasureInitialPupilSize());

        StartCoroutine(ScareDection());
    }
Beispiel #44
0
    public Game()
    {
        one = 1;
        map = new Map();
        performanceinfo = new DictionaryStringString();
        AudioEnabled = true;
        AutoJumpEnabled = false;
        playerPositionSpawnX = 15 + one / 2;
        playerPositionSpawnY = 64;
        playerPositionSpawnZ = 15 + one / 2;

        TextureId = new int[MaxBlockTypes][];
        for (int i = 0; i < MaxBlockTypes; i++)
        {
            TextureId[i] = new int[6];
        }
        TextureIdForInventory = new int[MaxBlockTypes];
        language = new Language();
        lastplacedblockX = -1;
        lastplacedblockY = -1;
        lastplacedblockZ = -1;
        mLightLevels = new float[16];
        sunlight_ = 15;
        mvMatrix = new StackMatrix4();
        pMatrix = new StackMatrix4();
        mvMatrix.Push(Mat4.Create());
        pMatrix.Push(Mat4.Create());
        whitetexture = -1;
        cachedTextTexturesMax = 1024;
        cachedTextTextures = new CachedTextTexture[cachedTextTexturesMax];
        for (int i = 0; i < cachedTextTexturesMax; i++)
        {
            cachedTextTextures[i] = null;
        }
        packetLen = new IntRef();
        ENABLE_DRAW2D = true;
        AllowFreemove = true;
        enableCameraControl = true;
        textures = new DictionaryStringInt1024();
        ServerInfo = new ServerInformation();
        menustate = new MenuState();
        mouseleftclick = false;
        mouseleftdeclick = false;
        wasmouseleft = false;
        mouserightclick = false;
        mouserightdeclick = false;
        wasmouseright = false;
        ENABLE_LAG = 0;
        znear = one / 10;
        CameraMatrix = new GetCameraMatrix();
        ENABLE_ZFAR = true;
        TotalAmmo = new int[GlobalVar.MAX_BLOCKTYPES];
        LoadedAmmo = new int[GlobalVar.MAX_BLOCKTYPES];
        AllowedFontsCount = 1;
        AllowedFonts = new string[AllowedFontsCount];
        AllowedFonts[0] = "Verdana";
        fov = Game.GetPi() / 3;
        cameratype = CameraType.Fpp;
        ENABLE_TPP_VIEW = false;
        basemovespeed = 5;
        movespeed = 5;
        RadiusWhenMoving = one * 3 / 10;
        playervelocity = new Vector3Ref();
        LocalPlayerId = -1;
        dialogs = new VisibleDialog[512];
        dialogsCount = 512;
        blockHealth = new DictionaryVector3Float();
        playertexturedefault = -1;
        a = new AnimationState();
        constRotationSpeed = one * 180 / 20;
        modmanager = new ClientModManager1();
        particleEffectBlockBreak = new ModDrawParticleEffectBlockBreak();
        PICK_DISTANCE = 4.1f;
        selectedmodelid = -1;
        grenadetime = 3;
        rotationspeed = one * 15 / 100;
        entities = new Entity[entitiesMax];
        for (int i = 0; i < entitiesMax; i++)
        {
            entities[i] = null;
        }
        entitiesCount = 512;
        PlayerPushDistance = 2;
        const int KeysMax = 256;
        keyboardState = new bool[KeysMax];
        for (int i = 0; i < KeysMax; i++)
        {
            keyboardState[i] = false;
        }
        keyboardStateRaw = new bool[KeysMax];
        for (int i = 0; i < KeysMax; i++)
        {
            keyboardStateRaw[i] = false;
        }
        overheadcameradistance = 10;
        tppcameradistance = 3;
        TPP_CAMERA_DISTANCE_MIN = 1;
        TPP_CAMERA_DISTANCE_MAX = 10;
        options = new OptionsCi();
        overheadcameraK = new Kamera();
        fillAreaLimit = 200;
        speculativeCount = 0;
        speculative = new Speculative[speculativeMax];
        typinglog = new string[1024 * 16];
        typinglogCount = 0;
        NewBlockTypes = new Packet_BlockType[GlobalVar.MAX_BLOCKTYPES];
        localplayeranim = new AnimationState();
        localplayeranimationhint = new AnimationHint();
        enable_move = true;
        handTexture = -1;
        modelViewInverted = new float[16];
        GLScaleTempVec3 = Vec3.Create();
        GLRotateTempVec3 = Vec3.Create();
        GLTranslateTempVec3 = Vec3.Create();
        identityMatrix = Mat4.Identity_(Mat4.Create());
        Set3dProjectionTempMat4 = Mat4.Create();
        getAsset = new string[1024 * 2];
        PlayerStats = new Packet_ServerPlayerStats();
        mLightLevels = new float[16];
        for (int i = 0; i < 16; i++)
        {
            mLightLevels[i] = one * i / 15;
        }
        soundnow = new BoolRef();
        camera = Mat4.Create();
        packetHandlers = new ClientPacketHandler[256];
        player = new Entity();
        player.position = new EntityPosition_();
        currentlyAttackedEntity = -1;
        ChatLinesMax = 1;
        ChatLines = new Chatline[ChatLinesMax];
        ChatLineLength = 64;
        audio = new AudioControl();
        CameraEyeX = -1;
        CameraEyeY = -1;
        CameraEyeZ = -1;
        controls = new Controls();
        movedz = 0;
        taskScheduler = new TaskScheduler();
        commitActions = ListAction.Create(16 * 1024);
        constWallDistance = 0.3f;
        mouseSmoothing = true;
    }