init() public static méthode

public static init ( ) : void
Résultat void
Exemple #1
0
        private void Start()
        {
            Debug.Log("Starting Network Manager");

            Instance = this;

            NetPeerConfiguration config = new NetPeerConfiguration("RebuildZoneServer");

#if DEBUG
            UnloadOldScenes();

            //config.SimulatedMinimumLatency = 0.1f;
            //config.SimulatedLoss = 0.05f;
#endif

            LeanTween.init(4000);

            client = new NetClient(config);
            client.Start();

            NetOutgoingMessage outMsg = client.CreateMessage();
            outMsg.Write("A Client");

            var target = File.ReadAllText(Path.Combine(Application.streamingAssetsPath, "serverconfig.txt"));
            var s      = target.Split(':');

            client.Connect(s[0], int.Parse(s[1]), outMsg);

            Debug.Log($"Connecting to server at target {target}...");

            lastPing = Time.time;
        }
    // Use this for initialization
    void Awake()
    {
        //if (PlayerPrefs.GetInt("TimeBomb") != 1)
        {
            //Application.targetFrameRate = 300;
            GameManager.Instance.Initialize();
            MusicManager.InitMusicManager();
            GameManager.Instance.Load();
            LeanTween.init(800);
#if UNITY_EDITOR
            Cheats.IsCheatEnabled = true;
#else
            Cheats.IsCheatEnabled = false;
#endif

#if UNITY_STANDALONE_WIN
            string[] args = System.Environment.GetCommandLineArgs();
            foreach (var arg in args)
            {
                if (arg == "/killian")
                {
                    Cheats.IsCheatEnabled = true;
                }
            }
#endif
        }
    }
    // Use this for initialization
    void Start()
    {
        Time.timeScale = 1f;
        g1             = GameObject.Find("T6");
        g2             = GameObject.Find("T7");
        g3             = GameObject.Find("T8");
        g4             = GameObject.Find("T9");
        g5             = GameObject.Find("T10");
        g6             = GameObject.Find("Text2");
        t1             = g1.GetComponent <Text>();
        t2             = g2.GetComponent <Text>();
        t3             = g3.GetComponent <Text>();
        t4             = g4.GetComponent <Text>();
        t5             = g5.GetComponent <Text>();
        t = g6.GetComponent <Text>();

        test  = new Vector3(1000, -316.5f, 0);
        test2 = new Vector3(5000, 0, 0);
        test2 = new Vector3(5000, 0, 0);
        LeanTween.init(1000);
        StartCoroutine(Wait(1));
        StartCoroutine(Wait1(5));
        StartCoroutine(Wait2(10));
        StartCoroutine(Wait3(20));
        StartCoroutine(Wait4(30));
        StartCoroutine(Wait5(40));
        StartCoroutine(Quit(52));
    }
Exemple #4
0
    public void Awake()
    {
        DestroyImmediate(GameObject.Find("[DOTween]"));

        LeanTween.init(animateCount <= 10000 ? animateCount + 1000 : animateCount);

        int     iter = 0;
        int     side = System.Convert.ToInt32(Mathf.Pow(animateCount * 1.0f, 1.0f / 3.0f));
        Vector3 p;

        cubes = new GameObject[side * side * side];
        for (int i = 0; i < side; i++)
        {
            for (int j = 0; j < side; j++)
            {
                for (int k = 0; k < side; k++)
                {
                    GameObject cube = showVisuals ? GameObject.Instantiate(animatePrefabVisualize) : GameObject.Instantiate(animatePrefab);
                    p = new Vector3(i * 3, j * 3, k * 3);
                    cube.transform.position = p;
                    cube.name = "cube" + iter;

                    cubes[iter] = cube;
                    iter++;
                }
            }
        }
    }
    void Initialize()
    {
        _cachedMainCamera = Camera.main;

        SingleTouchManager.instance.DragSensitivity = LunarVariables.dragSensitivity;

        LeanTween.init(800);

        float defaultRatio = GameConstants.DEFAULT_SCREEN_WIDTH / GameConstants.DEFAULT_SCREEN_HEIGHT;
        float screenRatio  = (float)Screen.width / Screen.height;

        transform.localScale *= Mathf.Min(screenRatio / defaultRatio, 1.0f);

        TILE_LAYER  = LayerMask.NameToLayer("Tile");
        BLOCK_LAYER = LayerMask.NameToLayer("Block");

        _theme = _themeDB.GetTheme(_selectedTheme);
        if (_theme == null)
        {
            _theme = _themeDB.GetTheme(0);
        }

        IncreaseCellBuffer(_board.tiles.Length);

        _board.Initialize();
        _block.Initialize();

        ResetReplayInterstitialTime();
    }
Exemple #6
0
    // Use this for initialization
    private void Start()
    {
        DebugSettings = Resources.Load <DebugSettings>("Scriptable/DebugSettings");
        LeanTween.init(800);
#if FACEBOOK
        FacebookEnable = true;
        if (FacebookEnable && (!NetworkManager.THIS?.IsLoggedIn ?? false))
        {
            FacebookManager.THIS.CallFBInit();
        }
        else
        {
            Debug.LogError("Facebook not initialized, please, install database service");
        }
#else
        FacebookEnable = false;
#endif
#if UNITY_PURCHASING && UNITY_INAPPS
        gameObject.AddComponent <UnityInAppsIntegration>();
        enableInApps = true;
#else
        enableInApps = false;
#endif

//        if (!THIS.enableInApps)
//            GameObject.Find("CanvasMap/SafeArea/Gems").gameObject.SetActive(false);

        gameStatus = GameState.Map;
    }
Exemple #7
0
    private IEnumerator animation()
    {
        LeanTween.init(1000);
        LeanTween.move(alas1, new Vector3(-8.83499993e-08f, -7.03000021f, 0), 1f);

        yield return(new WaitForSeconds(1f));

        LeanTween.move(alas3, new Vector3(1.70000005f, -4.40000105f, -1.79999995f), 1f);
        yield return(new WaitForSeconds(1f));

        LeanTween.move(alas2, new Vector3(-3.70000005f, -5.00000048f, 0), 1f);
        yield return(new WaitForSeconds(1f));

        LeanTween.move(alas1, new Vector3(-8.83499993e-08f, -5.03000021f, 0), 1.5f);
        yield return(new WaitForSeconds(1.5f));

        Instantiate(firework, spawnFirework[0].position, spawnFirework[0].rotation);
        Instantiate(firework, spawnFirework[1].position, spawnFirework[1].rotation);
        LeanTween.move(CurrentCharacter, new Vector3(0, 1, 0), 4f);
        yield return(new WaitForSeconds(4f));

        win.SetActive(true);
        yield return(new WaitForSeconds(0.5f));

        mainmenu.SetActive(true);
        Cursor.lockState = CursorLockMode.None;
        Cursor.visible   = true;
    }
Exemple #8
0
        private void Awake()
        {
            // Set the maximum number of simultaneous tweens
            LeanTween.init(30000);

            _navigation  = GameObject.FindGameObjectWithTag("Navigation").GetComponent <NavigationScript>();
            _moveDisplay = GameObject.FindGameObjectWithTag("MoveDisplay").GetComponent <MoveDisplay>();
            _gameAudio   = GameObject.FindGameObjectWithTag("GameAudio").GetComponent <GameAudio>();

            // Set the game's strings to their localized versions
            var language = Levels.CurrentLanguage;

            if (language.Equals("default"))
            {
                return;
            }

            try {
                var map = new Dictionary <string, string> {
                    ["MusicToggleText"] = "music",
                    ["SfxToggleText"]   = "sfx",
                    ["CreditText"]      = "credit",
                    ["VersionText"]     = "version"
                };

                foreach (var entry in map)
                {
                    var textDisplay = GameObject.FindGameObjectWithTag(entry.Key).GetComponent <Text>();
                    textDisplay.text = Levels.Localization[language][entry.Value];
                }
            } catch (Exception e) {
                Debug.LogWarning("Failed to apply localization for " + language + "\n" + e);
            }
        }
Exemple #9
0
    private void Awake()
    {
        Debug.Log("GameManager.Awake()");

        mainCamera = Camera.main;
        Input.multiTouchEnabled = false;
        LeanTween.init(800);
    }
Exemple #10
0
 override protected void Awake()
 {
     base.Awake();
     DOTween.Init(true, false);
     DOTween.useSafeMode = doTweenSafeMode;
     HOTween.Init(true, false, false);
     LeanTween.init(Convert.ToInt32(numTweensList[numTweensList.Length - 1]) + 1);
 }
 // Use this for initialization
 void Start()
 {
     LeanTween.init(1);
     // Fire up a bunch with onUpdates
     LeanTween.moveX(cube1, 10f, 1f).setOnUpdate((float val) =>
     {
         Debug.Log("on update.... val:" + val + " cube1.x:" + cube1.transform.position.x);
     });
 }
Exemple #12
0
    void Awake()
    {
        MainCamera              = Camera.main;
        EventManager            = new EventManager();
        Input.multiTouchEnabled = false;
        LeanTween.init(800);

        EventManager.OnSceneLoadEnd += OnSceneLoadEnd;
    }
Exemple #13
0
Fichier : Main.cs Projet : lumoh/TT
    void Start()
    {
        GameEventManager.RegisterForEvent(GameEventType.RESTART, handleRestart);

        Application.targetFrameRate = 60;
        LeanTween.init(1000);

        spawnBoard();
    }
Exemple #14
0
    public void Start()
    {
        rand                    = new System.Random();
        EventManager            = new EventManager();
        Input.multiTouchEnabled = false;
        LeanTween.init(800);

        IsTimeStop = true;
    }
Exemple #15
0
        private void Awake()
        {
            // Set the maximum number of simultaneous tweens
            LeanTween.init(30000);

            _navigation  = GameObject.FindGameObjectWithTag("Navigation").GetComponent <NavigationScript>();
            _moveDisplay = GameObject.FindGameObjectWithTag("MoveDisplay").GetComponent <MoveDisplay>();
            _gameAudio   = GameObject.FindGameObjectWithTag("GameAudio").GetComponent <GameAudio>();
        }
Exemple #16
0
    private void Awake()
    {
        LeanTween.init(10000);


        instance = this;

        npcs = new List <NPC>();
    }
Exemple #17
0
 private void Start()
 {
     LeanTween.init();
     lt = LeanTween.move(base.gameObject, 100f * Vector3.one, 2f);
     id = lt.id;
     LeanTween.pause(id);
     ff  = LeanTween.move(base.gameObject, Vector3.zero, 2f);
     fid = ff.id;
     LeanTween.pause(fid);
 }
    /************************************************************************
    *	                Getter & Setter Declaration	                        *
    ************************************************************************/

    /************************************************************************
    *	                Initialize & Destroy Declaration	                *
    ************************************************************************/

    /************************************************************************
    *	                Life Cycle Method Declaration	                    *
    ************************************************************************/
    protected override IEnumerator StartExample()
    {
        XTween.Initialize(1000);
        #if PERFORMANCE_TEST
        LeanTween.init(1100);
        #endif
        yield return(null);

        this._position2D = this.target2D.transform.localPosition;
        this._position3D = this.target3D.transform.localPosition;
    }
Exemple #19
0
    private void Awake()
    {
        LeanTween.init(data.sizeX * data.sizeY);
        cellGrid       = new Cell[data.sizeX * data.sizeY];
        cellsToDestroy = new List <Cell> [data.sizeX];

        offset             = cellPrefab.GetComponent <SpriteRenderer>().bounds.size.x;
        transform.position = new Vector3(-offset * (data.sizeX - 1) / 2f, -offset * (data.sizeY - 1) / 2f, 0); // move grid so spawning cells start at 0,0

        InitializeGrid();
    }
Exemple #20
0
    protected override void Initialize()
    {
        base.Initialize();

        mainCamera = Camera.main;
        Events     = new EventManager();
        Input.multiTouchEnabled = false;
        LeanTween.init(800);

        EventManager.OnSceneLoadEnd += OnSceneLoadEnd;
    }
Exemple #21
0
    void Start()
    {
        LeanTween.init();

        lt = LeanTween.move(gameObject, 100 * Vector3.one, 2);
        id = lt.id;
        LeanTween.pause(id);

        ff  = LeanTween.move(gameObject, Vector3.zero, 2);
        fid = ff.id;
        LeanTween.pause(fid);
    }
Exemple #22
0
 void Init()
 {
     DataManager.Init();
     FacebookAPI.Init();
     MyLocalize.InitData();
     LeanTween.init();
     #if UNITY_ANDROID
     onKeyBackClicked = new List <System.Action>();
     #endif
     Application.targetFrameRate = 60;
     Screen.sleepTimeout         = SleepTimeout.NeverSleep;
 }
Exemple #23
0
    private void Start()
    {
        EventSystemGame.current.FadePlayer(1, 0.5f);//fade this start of the mainmenu loading
        EventSystemGame.current.FadePlayer(2, 0.5f);

        bonusItemReward = 150; //start bonus amount at 150

        EventSystemGame.current.PlaySound("Theme");

        //init leantween
        LeanTween.init(1600);
    }
Exemple #24
0
    private void Initialize()
    {
        m_graphic      = GetComponent <Graphic>();
        m_defaultColor = m_graphic.color;

        if (m_type == Type.IMAGE)
        {
            m_image = GetComponent <Image>();
        }

        LeanTween.init();
        bInitialized = true;
    }
Exemple #25
0
 void MoveShieldEnemy()
 {
     LeanTween.init(800);
     //LeanTween.move(this.gameObject, new Vector3(this.transform.position.x + -1f, this.transform.position.y + 2f, this.transform.position.z), 1f);
     if (this.transform.position.y <= -2f)
     {
         LeanTween.moveY(this.gameObject, this.transform.position.y + 2f, 2f);
     }
     else if (this.transform.position.y >= 4f)
     {
         LeanTween.moveY(this.gameObject, this.transform.position.y + -2f, 2f);
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     entitiesContainer = transform.Find("Entities").gameObject;
     propsContainer    = transform.Find("Props").gameObject;
     avatar            = entitiesContainer.transform.Find("Avatar").GetComponent <Avatar>();
     lightSwitch       = propsContainer.transform.Find("LightSwitch").GetComponent <LightSwitch>();
     door.Add(propsContainer.transform.Find("Doors").Find("DoorLeft").GetComponent <Door>());
     door.Add(propsContainer.transform.Find("Doors").Find("DoorRight").GetComponent <Door>());
     ballSpawner   = propsContainer.transform.Find("BallSpawner").GetComponent <BallSpawner>();
     ballDestroyer = propsContainer.transform.Find("BallDestroyer").GetComponent <BallDestroyer>();
     LeanTween.init(800);
     avatar.transform.position = Vector3.zero;
 }
Exemple #27
0
    // Use this for initialization
    void Awake()
    {
//		Application.targetFrameRate = 30;
        if (!GameManager.Instance.Initialized)
        {
            GameManager.Instance.Initialize();
        }
        MusicManager.InitMusicManager();
        if (!GameManager.Instance.Loaded)
        {
            GameManager.Instance.Load();
        }
        LeanTween.init(1000);
    }
        //////////////////////////////////////////////////////////////////////////////////
        // Instance Methods


        public void Awake()
        {
            //Debug.Log("LeanTweenBridge: Awake: this: " + this + " bridge: " +  ((bridge == null) ? "null" : ("" + bridge)));

            if (leanTweenBridge == null)
            {
                leanTweenBridge = this;
            }
            else
            {
                Debug.LogError("LeanTweenBridge: Awake: There should only be one leanTweenBridge!");
            }

            LeanTween.init(maxTweens);
        }
Exemple #29
0
 void StartGame()
 {
     LeanTween.init(2000);
     m_PlayerOriginScale = Player.localScale;
     m_CurrentLevel      = 0;
     foreach (var item in BallGroups)
     {
         item.ReCreateBallInGame();
     }
     for (int i = 0; i < LevelStates.Count; i++)
     {
         CalualteRandomPoint(LevelStates[i]);
     }
     GameStart = true;
 }
Exemple #30
0
    private void Awake()
    {
#if UNITY_EDITOR
        BaseOnline.Tracking = true;
#endif

        Application.targetFrameRate = 60;
        Random.InitState(DateTime.UtcNow.Millisecond + DateTime.UtcNow.Second + DateTime.UtcNow.Minute);
        LeanTween.init();

        Preferences.LoadPreferences();
        LocalizationData.LoadLocalizationLocal();

        SceneManager.LoadScene(SceneName.Home);
    }