Ejemplo n.º 1
0
 public void SetBonus(CanvasManager.Item value)
 {
     activeItems.Add(new Item(value.Duration, value.Influence));
     activeItems[activeItems.Count - 1].Go = (GameObject)Instantiate(value.ItemPrefab, this.transform.position, this.transform.rotation);
     activeItems[activeItems.Count - 1].Go.transform.SetParent(this.transform);
     bonus += value.Influence;
 }
Ejemplo n.º 2
0
    void Awake()
    {
        gps = GameObject.FindGameObjectWithTag("Gps").GetComponent<GpsWithoutUi>();
        cm = GameObject.FindGameObjectWithTag("Ui").GetComponent<CanvasManager>();
        PositionUtilities.Init();


    }
Ejemplo n.º 3
0
	// Update is called once per frame
	void Update () {
		if (timerEnabled) {
			totalTime+=Time.deltaTime;
		}
		if (canvas == null) {
			canvas = GameObject.FindObjectOfType<CanvasManager>();
		} else {
			canvas.timeText.text = TimeToStringFormat(totalTime);
		}
	}
Ejemplo n.º 4
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 5
0
        public ListView()
        {
            column_layout            = new Pango.Layout(PangoContext);
            CanFocus                 = true;
            selection_proxy.Changed += delegate { InvalidateList(); };

            HasTooltip        = true;
            QueryTooltip     += OnQueryTooltip;
            DirectionChanged += (o, a) => SetDirection();
            manager           = new CanvasManager(this);
            OnStyleUpdated();
        }
Ejemplo n.º 6
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this);
     }
     else if (instance != this)
     {
         Destroy(this.gameObject);
     }
 }
Ejemplo n.º 7
0
 private void Awake()
 {
     /*if (Instance != this)
      * {
      *  Destroy(gameObject);
      * }*/
     cm      = CanvasManager.Instance;
     pm      = Player_movement.Instance;
     sm      = SpawnManager.Instance;
     posXMax = transform.position.x;
     can     = true;
 }
Ejemplo n.º 8
0
 void Awake()
 {
     if (main == null)
     {
         main = this;
     }
     else
     {
         Debug.LogError("Deux CanvasManager sur la scène !");
         Destroy(this);
     }
 }
Ejemplo n.º 9
0
    public IEnumerator Connecting()
    {
        Debug.Log("开始动画");
        Submit.btn.interactable = false;
        TimeCountDown.instance.BreakCountDown();
        connectLine.ShowAll();
        SoundManager.instance.playConnecting();
        yield return(new WaitForSeconds(6));

        SoundManager.instance.StopBGM();
        CanvasManager.startConversation();
    }
Ejemplo n.º 10
0
 public static void Refresh()
 {
     if (!instance)
     {
         instance = FindObjectOfType <CanvasManager>();
     }
     instance.layers = instance.canvas.GetComponentsInChildren <CanvasLayer>(true);
     for (int i = 0; i < instance.layers.Length; i++)
     {
         instance.layers[i].gameObject.SetActive(Layer == instance.layers[i].name);
     }
 }
Ejemplo n.º 11
0
    private void Awake()
    {
        // if the singleton hasn't been initialized yet
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;//Avoid doing anything else
        }

        instance = this;
        DontDestroyOnLoad(this.gameObject);
    }
Ejemplo n.º 12
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         //DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 13
0
    public ResultState(GameManager gameManagerRef, Kroken player)
    {
        this.gameManagerRef = gameManagerRef;

        // gameManagerRef.canvasManagerRef.ToggleVictoryPanel(true, player.GetName(), player.GetColor());
        CanvasManager.ActivateWinMenu(player);
        gameManagerRef.audioManagerRef.StopMusicTrack();

        PlayerManager.ClearPlayers();
        EnemyManager.StopSpawning();
        EnemyManager.ResetSpawner();
    }
Ejemplo n.º 14
0
 private void Awake()
 {
     if (Instance != null && Instance != this)
     {
         transform.parent = null;
         Destroy(this.gameObject);
     }
     else
     {
         Instance = this;
     }
 }
Ejemplo n.º 15
0
 public void Start()
 {
     colliderTwoD = GetComponent <Collider2D>();
     movement     = GetComponent <Movement>();
     canMan       = optionsMenuController.GetComponent <CanvasManager>();
     pokeData     = new PokemonData();
     isFinished   = false;
     foreach (string names in pokemonList.pokemon)
     {
         actualPokemonList.Add(new Pokemon(names));
     }
 }
Ejemplo n.º 16
0
 void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     if (main == null)
     {
         main = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 17
0
 private void MakeSingleton()
 {
     if (_instance != null)
     {
         DestroyImmediate(gameObject);
     }
     else
     {
         _instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
Ejemplo n.º 18
0
    public void Declaration(anAI ToFollow)
    {
        canvasManager = CanvasManager.Instance;
        transform.parent = canvasManager.accrocheAIstate;

        FondInterrogation.gameObject.SetActive(false);
        InterrogationAmount.fillAmount = 0;
        InterrogationAmount.gameObject.SetActive(false);
        Pursuit.gameObject.SetActive(false);

        myFighter = ToFollow;
        GetComponent<aFollowingUI>().theRenderer = ToFollow.GetComponent<Renderer>();
    }
Ejemplo n.º 19
0
    void Awake()
    {
        Instance  = this;
        lastLevel = Util.GetLastLevelPlayed();
        DOTween.Init();


        SetButtons();

        //ButtonLogic ();

        adjustUiForScreenSize();
    }
Ejemplo n.º 20
0
 /// <summary>
 /// Awake method that will run before Start()
 /// </summary>
 void Awake()
 {
     // An if that doesn't destroy the gameObject when loading a new scene
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 21
0
    private void Awake()
    {
        Application.targetFrameRate = 60;

        if (inst == null)
        {
            inst = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }
Ejemplo n.º 22
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        showingCanvasIdx = -1;
    }
Ejemplo n.º 23
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("btn start");
        _button = GetComponent <Button>();

        _canvasManager = CanvasManager.GetComponent <CanvasManager>();

        _button.onClick.AddListener(() =>
        {
            Debug.Log("btn click");
            _canvasManager.NextCanvas();
        });
    }
Ejemplo n.º 24
0
 protected override void OnExperimentSetup()
 {
     CanvasManager.Show();
     goalManager   = GoalManager.Instance;
     storesManager = StoresManager.Instance;
     _player       = PlayerController.Instance;
     //setup store types
     for (var i = 0; i < Settings.StoreTypes.Length; i++)
     {
         storesManager.Objects [i].SetType(Settings.StoreTypes [i]);
     }
     goalManager.HideAll();
 }
Ejemplo n.º 25
0
        protected override void OnExecute()
        {
            if (animationName != null && canvasTipology != null && prefab.IsExist(out var pagePrefab))
            {
                Transform pageObj = CanvasManager.GetWidget(pagePrefab.name, canvasTipology.value);

                if (pageObj != null && pageObj.TryGetComponent <GenericPage>(out GenericPage page))
                {
                    page.StartAnimation(animationName.value);
                }
            }
            EndAction();
        }
Ejemplo n.º 26
0
 private void Awake()
 {
     if (Instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         print("Instance set");
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
Ejemplo n.º 27
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
     mainCanvasManager = GameObject.Find("MainCanvas").GetComponent <CanvasManager>();
 }
Ejemplo n.º 28
0
    private void Awake()
    {
        // if the singleton hasn't been initialized yet
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;//Avoid doing anything else
        }

        instance = this;
        Init();
        DontDestroyOnLoad(this.gameObject);
    }
 private void updateAmount()
 {
     if (this.gems != null)
     {
         CanvasManager.ShowCanvas(itemPrice.GetComponent <CanvasGroup>());
         itemPrice.GetComponentInChildren <Text>().text = "" + this.gems.Count;
     }
     else
     {
         CanvasManager.HideCanvas(itemPrice.GetComponent <CanvasGroup>());
         itemPrice.GetComponentInChildren <Text>().text = "";
     }
 }
Ejemplo n.º 30
0
    private void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
        }
        else if (_instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Ejemplo n.º 31
0
 // Start is called before the first frame update
 void Start()
 {
     schedule = GameObject.Find("ScheduleManager");
     if (schedule)
     {
         ScheduleManager data          = schedule.GetComponent <ScheduleManager>();
         CanvasManager   canvasManager = canvas.GetComponent <CanvasManager>();
         if (data.classSchedule.Count != 0)
         {
             //canvasManager.updateClassScheduled(data.classSchedule);
         }
     }
 }
Ejemplo n.º 32
0
 public bool CheckIfWon()
 {
     if (AlreadyWon)
     {
         return(true);
     }
     if (count == 0)
     {
         object[] param = new object[1];
         param[0] = CurrentLevel;
         CanvasManager.Push(GlobalInfor.WinMenu, param); AlreadyWon = true; GameEventSystem.current.TimeControl(1);
     }
     return(count == 0);
 }
Ejemplo n.º 33
0
    void Start()
    {
        if (gameState == null)
        {
            gameState = new SplashScreenState(this);
        }

        audioManagerRef  = AudioManager.GetInstance();
        canvasManagerRef = CanvasManager.GetInstance();

        cam = Camera.main;

        loadManagerRef = new LoadManager();
    }
    // Use this for initialization
    void Start()
    {
        // First toggle in array
        _toggleCurrent = ToggleArray[0];
        // Next toggle in array
        _toggleNext = ToggleArray[System.Array.IndexOf(ToggleArray, _toggleCurrent) + 1];
        _toggleLast = ToggleArray[ToggleArray.Length - 1];
        _ready      = "true";

        _timeWait = 2.0f;

        _canvasManager = CanvasManager.GetComponent <CanvasManager>();
        Debug.Log("canvasexercise");
    }
Ejemplo n.º 35
0
    private void ProcessHit(DamageDealer damageDealer)
    {
        SetValue.PlayerHealth -= damageDealer.GetDamage();
        CanvasManager.UpdateHealthUI();

        damageDealer.Hit();

        if (SetValue.PlayerHealth <= 0)
        {
            AudioSource.PlayClipAtPoint(_deathClip, Camera.main.transform.position, _deathVolume);
            Invoke("GameOverDelay", _gameOverDelay);
            gameObject.SetActive(false);
        }
    }
Ejemplo n.º 36
0
    protected virtual void Init()
    {
        canvas = Canvas.FindObjectOfType<Canvas>();
        canvasManager = canvas.GetComponent<CanvasManager>();
        //WorldInterface.CreateGameWorld(worldSize);
        worldInterface = WorldInterface.CreateWorldInterface(worldSize);
        pointObjectManager = PointObjectManager.CreatePointObjectManager();

        actionManager = gameObject.AddComponent<ActionManager>();

        workManager = gameObject.AddComponent<WorkManager>();
        pathFinder = new Pathfinder();
        if (buildStartArea)
        {
            BuildStartArea();
        }
    }