public void GetDesc()
    {
        ObjetManager go = GameObject.FindGameObjectWithTag("GameController").GetComponent <ObjetManager>();

        go.locationText.text    = objet.Location;
        go.locationImage.sprite = objet.LocationImage;
    }
 private void Awake()
 {
     _objectGenerator = ObjectGenerator.Instance;
     _objectManager   = ObjetManager.Instance;
     _stats           = new List <Stat>();
     enabled          = false;
 }
Beispiel #3
0
    protected override void Awake()
    {
        base.Awake();

        _objectManager   = ObjetManager.Instance;
        _objectGenerator = ObjectGenerator.Instance;
        _zoneManager     = ZoneManager.Instance;
        _camera          = Camera.main;
        _mesh            = GetComponentInChildren <MeshFilter>().mesh;
        _meshCollider    = GetComponentInChildren <MeshCollider>();
        _meshFilter      = GetComponentInChildren <MeshFilter>();

        _objectManager.AddObject(this);
        _coll     = GetComponent <Collider>();
        _renderer = GetComponent <Renderer>();
        if (_coll == null)
        {
            foreach (Transform child in transform)
            {
                _coll     = child.GetComponent <Collider>();
                _renderer = child.GetComponent <Renderer>();
                if (_coll != null)
                {
                    continue;
                }
            }
        }
        _controls = Controls.Instance;
        _outline  = GetComponent <cakeslice.Outline>();
        if (_outline == null)
        {
            if (GetComponent <Collider>() != null)
            {
                _outline = gameObject.AddComponent <cakeslice.Outline>();
            }
            else
            {
                foreach (Transform child in transform)
                {
                    if (child.gameObject.GetComponent <Renderer>() != null && child.gameObject.GetComponent <cakeslice.Outline>() == null)
                    {
                        _outline = child.gameObject.AddComponent <cakeslice.Outline>();
                    }
                    else if (child.gameObject.GetComponent <cakeslice.Outline>() != null)
                    {
                        _outline = child.gameObject.GetComponent <cakeslice.Outline>();
                    }
                }
            }
        }
        if (_outline == null)
        {
            gameObject.AddComponent <BoxCollider>();
            _outline = gameObject.AddComponent <cakeslice.Outline>();
        }
    }
Beispiel #4
0
 private void Awake()
 {
     _camera          = Camera.main;
     _uiManager       = UIManager.Instance;
     _uiResources     = UIResources.Instance;
     _objectManager   = ObjetManager.Instance;
     _zoneManager     = ZoneManager.Instance;
     _objectGenerator = ObjectGenerator.Instance;
     _radialPanel     = _planet.MainRadial;
     _mainPanel       = MainPanel.Instance;
 }
Beispiel #5
0
    protected override void Awake()
    {
        base.Awake();

        _objectManager = ObjetManager.Instance;
        _zoneManager   = ZoneManager.Instance;
        _vertexManager = VertexManager.Instance;
        _transform     = transform;

        VerticeIds   = new List <Guid>();
        NeighbourIds = new List <Guid>();
        PathCosts    = new Dictionary <Guid, PathCost>();
        Resources    = new List <Resource>();
        TwippieIds   = new List <Guid>();
        Col          = UnityEngine.Random.ColorHSV();
    }
 public void Init()
 {
     _objectGenerator = ObjectGenerator.Instance;
     _objectManager   = ObjetManager.Instance;
     _stats           = new List <Stat>();
 }