Пример #1
0
        public void initialise(ASPPainter painter)
        {
            _painter = painter;

            ScreenMessages.PostScreenMessage("Paint Pointer - RMB or Escape to exit", 5, ScreenMessageStyle.UPPER_CENTER);

            if (_pointer == null)
            {
                GameObject modelObject = GameDatabase.Instance.GetModel(_pointerModel).gameObject;
                _pointer = Instantiate(modelObject) as GameObject;

                Collider[] colliders = _pointer.GetComponentsInChildren<Collider>(true);
                foreach (Collider collider in colliders)
                {
                    Destroy(collider);
                }

                _meshRenderers = _pointer.GetComponentsInChildren<MeshRenderer>(true);
                foreach (MeshRenderer mesh in _meshRenderers)
                {
                    mesh.material = new Material(Shader.Find("Transparent/Diffuse"));
                }

                _pointer.SetActive(true);
            }

            GameEvents.onVesselChange.Add(new EventData<Vessel>.OnEvent(this.OnVesselChange));
        }
Пример #2
0
 public void setPainter(ASPPainter painter)
 {
     _painter = painter;
 }
Пример #3
0
 public void finalisePainting()
 {
     if (_usedPaint == true && _startState != StartState.Editor)
     {
         if (_painter != null)
         {
             _painter.usePaint();
             _painter = null;
         }
         _usedPaint = false;
     }
     _gui = null;
 }