public void Start()
 {
     _terrainVolume = gameObject.GetComponent<TerrainVolume>();
     if (_terrainVolume == null) {
         DebugMsg.ComponentNotFound(Debug.Log,typeof(CarveTerrainVolumeComponent));
     }
 }
Esempio n. 2
0
 public void Init(Camera mainCamera, Camera landmarkCamera)
 {
     _main       = mainCamera;
     _landmark   = landmarkCamera;
     _saturation = _main.gameObject.GetComponent <UnsaturatePostEffect>();
     if (!_saturation)
     {
         DebugMsg.ComponentNotFound(Debug.LogWarning, typeof(UnsaturatePostEffect));
     }
     _outliner = _landmark.gameObject.GetComponent <OutlinerPostEffect>();
     if (!_outliner)
     {
         DebugMsg.ComponentNotFound(Debug.LogWarning, typeof(OutlinerPostEffect));
     }
     _depthOfField = _landmark.gameObject.GetComponent <DepthOfField>();
     if (!_depthOfField)
     {
         DebugMsg.ComponentNotFound(Debug.LogWarning, typeof(DepthOfField));
     }
     else
     {
         _depthOfField.enabled = false;
     }
     _shake = _main.GetComponent <CameraShake>();
     if (!_shake)
     {
         DebugMsg.ComponentNotFound(Debug.LogWarning, typeof(CameraShake));
     }
 }
 public void Start()
 {
     CurrentConfig = new LookConfig();
     _camera       = GetComponentInChildren <Camera>();
     if (FixedForward == null)
     {
         DebugMsg.ComponentNotFound(Debug.LogWarning, typeof(Transform), "Initialized with <b>this</b> object transform instead.");
         FixedForward = transform;
     }
 }
Esempio n. 4
0
        public override void DoInteraction()
        {
            Coffin.layer = LayerMaskManager.Get(Layer.DrawFront);
            MarkableComponent m = Coffin.GetComponent <MarkableComponent>();

            if (m != null)
            {
                m.enabled = false;
            }
            else
            {
                DebugMsg.ComponentNotFound(Debug.LogWarning, typeof(MarkableComponent));
            }
            AudioController.GetInstance().PlayPickupCoffin();
            Player.GetInstance().CurrentState = new DragCoffinState(Coffin);
        }
 public DriveCartInteraction(GameObject cart)
 {
     _cart = cart;
     foreach (Transform t in cart.GetComponentInChildren <Transform>())
     {
         if (t.gameObject.name == "Visuals")
         {
             _model = t.gameObject;
             break;
         }
     }
     _mark = cart.GetComponent <MarkableComponent>();
     if (_mark == null)
     {
         DebugMsg.ComponentNotFound(Debug.LogWarning, typeof(MarkableComponent));
     }
 }
        public CarveTerrainInteraction()
        {
            if (_digMarker == null)
            {
                _digMarker = GameObject.CreatePrimitive(PrimitiveType.Cube);
                Object.Destroy(_digMarker.GetComponent <Collider>());
                _digMarker.SetActive(false);
                _digMarker.name = "_digMarker";
                _digMarker.transform.localScale = new Vector3(4, 0.1f, 4);
                _digMarker.layer = LayerMaskManager.Get(Layer.Outline);
                _digMarker.GetComponent <MeshRenderer>().material = new Material(Shader.Find("UI/Default"));
                IconMarkerComponent icon = _digMarker.AddComponent <IconMarkerComponent>();
                icon.Init("Sprites/dig", new Color(0, 81.0f / 255.0f, 240.0f / 255.0f));
            }

            _player = Player.GetInstance();

            string     terrainName = "Terrain Volume";
            GameObject terrain     = GameObject.Find(terrainName);

            if (!terrain)
            {
                DebugMsg.GameObjectNotFound(Debug.LogError, terrainName);
            }
            else
            {
                var terrainVolume = terrain.GetComponent <TerrainVolume>();
                if (!terrainVolume)
                {
                    DebugMsg.ComponentNotFound(Debug.LogError, typeof(TerrainVolume));
                }

                _terrainCarver = terrain.GetComponent <CarveTerrainVolumeComponent>();
                if (!_terrainCarver)
                {
                    DebugMsg.ComponentNotFound(Debug.LogError, typeof(CarveTerrainVolumeComponent));
                }
            }
        }