Ejemplo n.º 1
0
 /// <summary>
 /// 初始化产生的甜品位置信息
 /// </summary>
 /// <param name="_x"></param>
 /// <param name="_y"></param>
 /// <param name="_gameManager"></param>
 /// <param name="_type"></param>
 public void Init(int _x, int _y, GamaManager _gameManager, GamaManager.SweetsType _type)
 {
     X           = _x;
     Y           = _y;
     gameManager = _gameManager;
     type        = _type;
 }
Ejemplo n.º 2
0
 void Awake()
 {
     if (gm == null)
     {
         gm = this;
     }
 }
Ejemplo n.º 3
0
 void Start()
 {
     cellUnderMouse    = null;
     isInvertoryActive = false;
     pc = GameObject.Find("Maya").GetComponent <PlayerController>();
     gm = GameObject.Find("GamaManager").GetComponent <GamaManager>();
     foreach (var cell in cells)
     {
         if (cell.GetComponent <InventoryCell>().currentWeapon)
         {
             weaponsNmber++;
         }
     }
 }
Ejemplo n.º 4
0
    void Awake()
    {
        m_Instance = this;
        //Check if instance already exists
        //If instance already exists and it's not this:
        //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a gamaManager.
        if (m_Instance == null)
        {
            m_Instance = this;
        }
        else if (m_Instance != this)
        {
            Destroy(gameObject);
        }

        //Sets this to not be destroyed when reloading scene
        DontDestroyOnLoad(gameObject);

        MqttSetting.allObjects = UnityEngine.Object.FindObjectsOfType <GameObject>();
        allObjects             = UnityEngine.Object.FindObjectsOfType <GameObject>();

        gamaManager = gameObject;
        MainCamera  = GameObject.Find("MainCamera");

        /*
         *
         *      // Create the plane game Object
         *      plane = GameObject.CreatePrimitive(PrimitiveType.Plane);
         *      plane.transform.localScale = new Vector3(20, 1, 20);
         *      plane.GetComponent<Renderer>().material = planeMaterial;
         *
         */

        // Create the Topic's manager GameObjects
        new GameObject(MqttSetting.COLOR_TOPIC_MANAGER).AddComponent <ColorTopic>();
        new GameObject(MqttSetting.POSITION_TOPIC_MANAGER).AddComponent <PositionTopic>();
        new GameObject(MqttSetting.SET_TOPIC_MANAGER).AddComponent <SetTopic>();
        new GameObject(MqttSetting.GET_TOPIC_MANAGER).AddComponent <GetTopic>();
        new GameObject(MqttSetting.MONO_FREE_TOPIC_MANAGER).AddComponent <MonoFreeTopic>();
        new GameObject(MqttSetting.MULTIPLE_FREE_TOPIC_MANAGER).AddComponent <MultipleFreeTopic>();
        new GameObject(MqttSetting.CREATE_TOPIC_MANAGER).AddComponent <CreateTopic>();
        new GameObject(MqttSetting.DESTROY_TOPIC_MANAGER).AddComponent <DestroyTopic>();
        new GameObject(MqttSetting.MOVE_TOPIC_MANAGER).AddComponent <MoveTopic>();
        new GameObject(MqttSetting.NOTIFICATION_TOPIC_MANAGER).AddComponent <NotificationTopic>();
        new GameObject(MqttSetting.PROPERTY_TOPIC_MANAGER).AddComponent <PropertyTopic>();
        new GameObject(MqttSetting.MAIN_TOPIC_MANAGER).AddComponent <MainTopic>();
    }
Ejemplo n.º 5
0
 private void Start()
 {
     link = FindObjectOfType <GamaManager>();
 }
Ejemplo n.º 6
0
 void OnDestroy()
 {
     m_Instance = null;
 }
Ejemplo n.º 7
0
 void Awake()
 {
     Instance = this;
 }
Ejemplo n.º 8
0
 void Awake()
 {
     instance = this;
 }
Ejemplo n.º 9
0
 private void Awake()
 {
     Instance = this;
 }
Ejemplo n.º 10
0
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     instance = this;
 }