Inheritance: Behaviour
Example #1
0
 void OnEnable()
 {
     originPos = transform.position;
     originPos.y = 0.0f;
     mProj = GetComponent<Projector>();
     if (mProj != null) mProj.enabled = true;
 }
		//assign edilen objeler statik olmali
		public override void loadResources()
		{
			staticTowerObject = (GameObject)Resources.Load("3Ds/Towers/Physics/BallistaTower/TowerObject");            
			staticTowerIcon = (Texture2D)Resources.Load("3Ds/Towers/Physics/BallistaTower/GUI/towerIcon");
            staticCreateSound = (AudioClip)Resources.Load("Sound/tower_build");
			staticRangeProjector = ((GameObject)Resources.Load ("3Ds/Scenes/Game/RangeProjector")).GetComponent<Projector>();
		}
Example #3
0
    void Awake()
    {
        projector = GetComponent<Projector>();

        gridSize = projector.orthographicSize*2.0f;
        gridCenter = projector.transform.position;
    }
 static public int get_farClipPlane(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.Projector self = (UnityEngine.Projector)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.farClipPlane);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
 void Start()
 {
     projector = GetComponent<Projector>();
     origNearClipPlane = projector.nearClipPlane;
     origFarClipPlane = projector.farClipPlane;
     Late();
 }
 // Use this for initialization
 void Start()
 {
     projector = GetComponent<Projector>();
     projector.enabled = true;
     //endPos += new Vector3(endPos.x * Random.Range(-1,1),endPos.y * Random.Range(-1,1),endPos.z * Random.Range(-1,1));
     //endRot += new Vector3(endRot.x * Random.Range(-1,1),endRot.y * Random.Range(-1,1),endRot.z * Random.Range(-1,1));
 }
 static public int set_material(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.Projector self = (UnityEngine.Projector)checkSelf(l);
         UnityEngine.Material  v;
         checkType(l, 2, out v);
         self.material = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Example #8
0
 public void Set(int col, int row, TerrainType ter)
 {
     x = col;
     y = row - (col - (col%2)) / 2;
     z = -x - y;
     terrain = ter;
     available = true;
     highlighter = transform.FindChild("HighlightingProjector").gameObject.GetComponent<Projector>();
 }
 // Use this for initialization
 void Start()
 {
     proj = GetComponent<Projector>();
     //initialAspect = Screen.width/Screen.height;
     //proj.aspectRatio = initialAspect;
     camera = FirstPersonCharcter.GetComponent<Camera>();
     initialAspect = camera.aspect;
     proj.aspectRatio = initialAspect;
 }
    //Inicializa cosas para no tener que hacerlo siempre e_e
    void Start()
    {
        pos = new Vector2(transform.position.x,transform.position.z);
        elapsedCD = attackSecCD;

        //Display del area de ataque
        projector = this.GetComponentInChildren<Projector> ();
        projector.enabled = false;
        projector.orthographicSize = range;
    }
Example #11
0
 public void Dispose()
 {
     if (this.m_BrushProjector != null)
     {
         UnityEngine.Object.DestroyImmediate(this.m_BrushProjector.gameObject);
         this.m_BrushProjector = null;
     }
     UnityEngine.Object.DestroyImmediate(this.m_Preview);
     this.m_Preview = null;
 }
Example #12
0
 public void Dispose()
 {
   if ((bool) ((Object) this.m_BrushProjector))
   {
     Object.DestroyImmediate((Object) this.m_BrushProjector.gameObject);
     this.m_BrushProjector = (Projector) null;
   }
   Object.DestroyImmediate((Object) this.m_Preview);
   this.m_Preview = (Texture2D) null;
 }
Example #13
0
 // Use this for initialization
 void Start()
 {
     tailAim = Resources.Load<Texture>("Images/AimTail");
     boomAim = Resources.Load<Texture>("Images/AimPointer");
     pukeAim = Resources.Load<Texture>("Images/AimPuke");
     fishAim = Resources.Load<Texture>("Images/AimFish");
     projector = GetComponent<Projector>();
     projector.aspectRatio = 1;
     projector.transform.position = new Vector3(0, 10, 0);
     projector.enabled = false;
 }
	static public int get_orthographicSize(IntPtr l) {
		try {
			UnityEngine.Projector self=(UnityEngine.Projector)checkSelf(l);
			pushValue(l,true);
			pushValue(l,self.orthographicSize);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public int get_aspectRatio(IntPtr l) {
		try {
			UnityEngine.Projector self=(UnityEngine.Projector)checkSelf(l);
			pushValue(l,true);
			pushValue(l,self.aspectRatio);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Example #16
0
    void Start()
    {
        for (int i = 0; i < 80; i++)
        {
            frames[i] = Resources.Load("CausticsRender_0" + ((i+1) < 10 ? "0" + (i+1).ToString() : (i+1).ToString() ) ) as Texture2D;
        }

        projector = GetComponent<Projector>();
        NextFrame();
        InvokeRepeating("NextFrame", 1 / fps, 1 / fps);
    }
    // Use this for initialization
    void Start()
    {
        projector = GetComponent<Projector>();
        renderedFrames = new List<Texture>();

        for (int i = 0; i < numFrames; i++)
        {
            renderedFrames.Add(Resources.Load<Texture>(string.Format("CausticsRender_{0:D3}", i + 1)));
        }

        StartCoroutine("UpdateFrame");
    }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.Projector o;
			o=new UnityEngine.Projector();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Example #19
0
 static public int get_ignoreLayers(IntPtr l)
 {
     try {
         UnityEngine.Projector self = (UnityEngine.Projector)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.ignoreLayers);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.Projector o;
			o=new UnityEngine.Projector();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Example #21
0
 static public int get_nearClipPlane(IntPtr l)
 {
     try {
         UnityEngine.Projector self = (UnityEngine.Projector)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.nearClipPlane);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #22
0
 static public int get_fieldOfView(IntPtr l)
 {
     try {
         UnityEngine.Projector self = (UnityEngine.Projector)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.fieldOfView);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    // Use this for initialization
    void Start()
    {
        thisProjector = GetComponent<Projector>();
        fOriginalSize = thisProjector.orthographicSize;
        fSize = fOriginalSize;

        if(!bnPulseEnable) {

            thisProjector.orthographicSize = fOriginalSize + fMaxDistance;
        }
        this.thisProjector.material	= (bnPulseEnable == true ? healthMaterialsActive[textureIdx] : healthMaterialsInactive[textureIdx]);
    }
	static public int set_fieldOfView(IntPtr l) {
		try {
			UnityEngine.Projector self=(UnityEngine.Projector)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.fieldOfView=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public int set_material(IntPtr l) {
		try {
			UnityEngine.Projector self=(UnityEngine.Projector)checkSelf(l);
			UnityEngine.Material v;
			checkType(l,2,out v);
			self.material=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public int set_orthographicSize(IntPtr l) {
		try {
			UnityEngine.Projector self=(UnityEngine.Projector)checkSelf(l);
			float v;
			checkType(l,2,out v);
			self.orthographicSize=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.Projector o;
         o=new UnityEngine.Projector();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
	static public int set_ignoreLayers(IntPtr l) {
		try {
			UnityEngine.Projector self=(UnityEngine.Projector)checkSelf(l);
			int v;
			checkType(l,2,out v);
			self.ignoreLayers=v;
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Example #29
0
 static public int set_farClipPlane(IntPtr l)
 {
     try {
         UnityEngine.Projector self = (UnityEngine.Projector)checkSelf(l);
         float v;
         checkType(l, 2, out v);
         self.farClipPlane = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #30
0
 static public int set_isOrthoGraphic(IntPtr l)
 {
     try {
         UnityEngine.Projector self = (UnityEngine.Projector)checkSelf(l);
         bool v;
         checkType(l, 2, out v);
         self.isOrthoGraphic = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #31
0
 static void Projector_aspectRatio(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Projector _this = (UnityEngine.Projector)vc.csObj;
         var result = _this.aspectRatio;
         JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(result));
     }
     else
     {
         System.Single         arg0  = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
         UnityEngine.Projector _this = (UnityEngine.Projector)vc.csObj;
         _this.aspectRatio = arg0;
     }
 }
Example #32
0
 static void Projector_ignoreLayers(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Projector _this = (UnityEngine.Projector)vc.csObj;
         var result = _this.ignoreLayers;
         JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(result));
     }
     else
     {
         System.Int32          arg0  = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
         UnityEngine.Projector _this = (UnityEngine.Projector)vc.csObj;
         _this.ignoreLayers = arg0;
     }
 }
Example #33
0
 /* ----------------------------------------
  	* At Start, set up effects components (Line Renderer and Projector)
  	*/
 void Start()
 {
     // Add Line Renderer component
     line = gameObject.AddComponent<LineRenderer>();
     // Set the Material for the Line Renderer
     line.material = lineMat;
     // Set initial color for the Line Renderer's material
     line.material.SetColor("_TintColor", regularColor);
     // Set number of vertices
     line.SetVertexCount(2);
     // Set Line Renderer's width at each vertex
     line.SetWidth(lineWidth, lineWidth);
     // Assign object's Projector component to proj variable
     proj = GetComponent<Projector> ();
 }
Example #34
0
 static void Projector_orthographic(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Projector _this = (UnityEngine.Projector)vc.csObj;
         var result = _this.orthographic;
         JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result));
     }
     else
     {
         System.Boolean        arg0  = (System.Boolean)JSApi.getBooleanS((int)JSApi.GetType.Arg);
         UnityEngine.Projector _this = (UnityEngine.Projector)vc.csObj;
         _this.orthographic = arg0;
     }
 }
Example #35
0
 static void Projector_material(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Projector _this = (UnityEngine.Projector)vc.csObj;
         var result = _this.material;
         JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
     }
     else
     {
         UnityEngine.Material  arg0  = (UnityEngine.Material)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
         UnityEngine.Projector _this = (UnityEngine.Projector)vc.csObj;
         _this.material = arg0;
     }
 }
Example #36
0
 private void CreatePreviewBrush()
 {
     System.Type[] components = new System.Type[] { typeof(Projector) };
     GameObject obj2 = EditorUtility.CreateGameObjectWithHideFlags("TerrainInspectorBrushPreview", HideFlags.HideAndDontSave, components);
     this.m_BrushProjector = obj2.GetComponent(typeof(Projector)) as Projector;
     this.m_BrushProjector.enabled = false;
     this.m_BrushProjector.nearClipPlane = -1000f;
     this.m_BrushProjector.farClipPlane = 1000f;
     this.m_BrushProjector.orthographic = true;
     this.m_BrushProjector.orthographicSize = 10f;
     this.m_BrushProjector.transform.Rotate((float) 90f, 0f, (float) 0f);
     Material material = EditorGUIUtility.LoadRequired("SceneView/TerrainBrushMaterial.mat") as Material;
     material.SetTexture("_CutoutTex", (Texture2D) EditorGUIUtility.Load(EditorResourcesUtility.brushesPath + "brush_cutout.png"));
     this.m_BrushProjector.material = material;
     this.m_BrushProjector.enabled = false;
 }
Example #37
0
 /// <summary>
 /// Write the specified value using the writer.
 /// </summary>
 /// <param name="value">Value.</param>
 /// <param name="writer">Writer.</param>
 public override void Write(object value, ISaveGameWriter writer)
 {
     UnityEngine.Projector projector = (UnityEngine.Projector)value;
     writer.WriteProperty("nearClipPlane", projector.nearClipPlane);
     writer.WriteProperty("farClipPlane", projector.farClipPlane);
     writer.WriteProperty("fieldOfView", projector.fieldOfView);
     writer.WriteProperty("aspectRatio", projector.aspectRatio);
     writer.WriteProperty("orthographic", projector.orthographic);
     writer.WriteProperty("orthographicSize", projector.orthographicSize);
     writer.WriteProperty("ignoreLayers", projector.ignoreLayers);
     writer.WriteProperty("material", projector.material);
     writer.WriteProperty("enabled", projector.enabled);
     writer.WriteProperty("tag", projector.tag);
     writer.WriteProperty("name", projector.name);
     writer.WriteProperty("hideFlags", projector.hideFlags);
 }
Example #38
0
    /*public float drag = 3;
    public float maxVel = 30;
    public float accel = 5;
    public float deadzone = 0.6f;*/
    //private Animator animator;
    public override void Start()
    {
        base.Start();
        AIManager.staticManager.AddPeloton(myPeloton);  //Avisar al AIManager

        cursor = GameObject.Find("Cursor").GetComponent<PlayerCursor>();
        cursor.SetLeader(gameObject);

        callArea = gameObject.GetComponentInChildren<Projector>();
        callText = GameObject.Find("CallText");
        healthSlider = GameObject.Find("Slider").GetComponent<Slider>();

        pelotonSource = GetComponent<AudioSource>();

        radio = GameObject.Find(Names.RADIO).GetComponent<Radio>();
    }
        public ShadowProjector()
        {
            projectorGO = new GameObject();

            projector = projectorGO.AddComponent<Projector>();
            projector.nearClipPlane = 10;
            projector.fieldOfView = 60;
            projector.aspectRatio = 1;
            projector.orthographic = true;
            projector.farClipPlane = 200000000000;
            projector.orthographicSize = 2 * 10000000;

            //ShadowProjector.transform.localScale = scale * Vector3.one;
            projectorGO.layer = (int)Tools.Layer.Local;

            projector.material = new Material(ShadowShader);
        }
Example #40
0
File: Fog.cs Project: JJJohan/RTS
        public Fog()
        {
            // Init class
            m_open = new List<int>(m_size * m_size);
            m_closed = new List<int>(m_size * m_size);
            for (int i = 0; i < (m_size * m_size); ++i)
                m_closed.Add(i);
            m_time = 0f;
            m_unitCount = 0;
            m_buildingCount = 0;

            // Init object
            m_object = new GameObject();
            m_object.transform.position = new Vector3(0f, 200f, 0f);
            m_object.transform.eulerAngles = new Vector3(90f, 0f, 0f);
            m_object.name = "Fog";
            m_object.layer = 12;

            // Init collider
            BoxCollider collider = m_object.AddComponent<BoxCollider>();
            collider.size = new Vector3(1000f, 1000f, 1f);

            // Init texture
            m_tex = new Texture2D(m_size, m_size);
            m_pixels = new Color[m_size * m_size];
            for (int i = 0; i < m_size * m_size; ++i)
                m_pixels[i] = Color.black;
            m_tex.SetPixels(m_pixels);
            m_tex.Apply();

            // Init material
            Material mat = new Material(Shader.Find("Transparent/Diffuse"));
            mat.mainTexture = m_tex;

            // Init projector
            m_projector = m_object.AddComponent<Projector>();
            m_projector.orthographic = true;
            m_projector.orthoGraphicSize = 1000f;
            m_projector.farClipPlane = 300f;
            m_projector.material = mat;
            m_projector.ignoreLayers = 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 5 | 1 << 6 | 1 << 7 | 1 << 9 | 1 << 10 | 1 << 11;
        }
Example #41
0
		public virtual void createTower (Tower t)
		{
			tower = t;
			t.tag = this;

			towerObject = (GameObject)GameObject.Instantiate(childStaticTowerObject);
			towerObject.name = "t_" + tower.board.instanceId + "_" + tower.indexOnBoard;
			towerObject.transform.position = tower.board.getTowerPosition(tower.indexOnBoard);
			
			rangeProjector = (Projector)GameObject.Instantiate(childStaticRangeProjector);
			rangeProjector.transform.parent = towerObject.transform;
			rangeProjector.transform.localPosition = new Vector3(0, 0.2f, 0);
			rangeProjector.orthographicSize = tower.stats.baseRange;
			rangeProjector.enabled = false;

            GameObject.Instantiate(UIControllerGame.getInstance().createTowerEffect, towerObject.transform.position, Quaternion.identity);

		    soundPlayer = towerObject.AddComponent<AudioSource>();
		    soundPlayer.volume = 1;
		    soundPlayer.PlayOneShot((AudioClip)Resources.Load("Sound/tower_build"));
		}
Example #42
0
    public void init()
    {
        CharacterController character = GetComponentInParent<CharacterController>();
        if( character != null )
        {
            parentBounds = character.bounds;
        }
        else
        {
            BoxCollider box = GetComponentInParent<BoxCollider>();
            if (box != null)
            {
                parentBounds = box.bounds;
            }
        }

        projector = GetComponent<Projector>();

        if (parentBounds != null && projector != null)
        {
                projector.orthographicSize = Mathf.Max( parentBounds.extents.x, parentBounds.extents.z )*2 + .5f;
        }
    }
Example #43
0
 static public int get_material(IntPtr l)
 {
     UnityEngine.Projector o = (UnityEngine.Projector)checkSelf(l);
     pushValue(l, o.material);
     return(1);
 }
Example #44
0
		public virtual void createMinion (Assets.Scripts.Engine.Minions.Minion minion)
		{
			this.minion = minion;
			minion.tag = this;
			minionObject = (GameObject)GameObject.Instantiate(childStaticMinionObject);
			minionObject.name = "m_" + minion.instanceId;
			
            healthBar = minionObject.transform.FindChild("HealthBar").gameObject.GetComponent<HealthBarDrawer>();
		    if (healthBar != null)
		    {
		        healthBar.health = (int) minion.stats.health;
		        healthBar.maxHealth = (int) minion.stats.healthTotal;
		    }


		    animations = (Animation[]) minionObject.GetComponentsInChildren<Animation>();
            foreach (Animation animation in animations)
                if(animation["walk"] != null)
			        animation["walk"].speed = minion.stats.baseMovementSpeed * walkAnimationSpeedMultiplier();

			rangeProjector = (Projector)GameObject.Instantiate(childStaticRangeProjector);
			rangeProjector.transform.parent = minionObject.transform;
			rangeProjector.transform.localPosition = new Vector3(0, 0.2f, 0);
			rangeProjector.orthographicSize = 0.2f;
			rangeProjector.enabled = false;

		    soundPlayer = minionObject.AddComponent<AudioSource>();
		    soundPlayer.volume = 2;
            soundPlayer.rolloffMode = AudioRolloffMode.Linear;
		    if (spawnSound == null)
		        spawnSound = Resources.Load<AudioClip>("Sound/minion_spawn");
		    soundPlayer.clip = spawnSound;
            soundPlayer.Play();
		}
		public override void loadResources ()
		{
			staticMinionObject = (GameObject)Resources.Load("3Ds/Minions/Chemistry/ChemistryStudentMinion/MinionObject"); 
			staticMinionIcon = Resources.Load<Texture2D>("3Ds/Minions/Chemistry/ChemistryStudentMinion/GUI/minionIcon");
			staticRangeProjector = ((GameObject)Resources.Load ("3Ds/Scenes/Game/RangeProjector")).GetComponent<Projector>();
		}
 void Start()
 {
     projector = GetComponent<Projector>();
     InvokeRepeating("NextFrame", 0, 1 / fps);
 }
 public virtual void Init()
 {
     selectProjector = GetComponentInChildren<Projector>();
 }
Example #48
0
 void Awake()
 {
     shadowProjectorTransform = GameObject.Find("BlobShadowProjector").transform;
     shadowProjector = shadowProjectorTransform.gameObject.GetComponent<Projector>();
 }
Example #49
0
 static public int get_isOrthoGraphic(IntPtr l)
 {
     UnityEngine.Projector o = (UnityEngine.Projector)checkSelf(l);
     pushValue(l, o.isOrthoGraphic);
     return(1);
 }
Example #50
0
 static public int get_aspectRatio(IntPtr l)
 {
     UnityEngine.Projector o = (UnityEngine.Projector)checkSelf(l);
     pushValue(l, o.aspectRatio);
     return(1);
 }
Example #51
0
	private Projector projector;			// used if projector on this or child object found

	#endregion
	// ====================================================================================================================
	#region pub

	void Start()
	{
		units = new List<NaviUnit>();

		linkOnOffSwitch = gameObject.GetComponent<TNELinksOnOffSwitch>();
		movesMod = gameObject.GetComponent<TNEMovementModifier>();

		if (!projector) projector = gameObject.GetComponent<Projector>();
		if (!projector && transform.childCount > 0)
		{
			for (int i = 0; i < transform.childCount; i++)
			{
				projector = transform.GetChild(i).GetComponent<Projector>();
				if (projector) break;
			}
		}
	}
Example #52
0
 protected void OnEnable()
 {
     this.DomeTransform = base.transform;
     if (Camera.main == null)
     {
         Debug.LogWarning("Main camera does not exist or is not tagged 'MainCamera'.");
     }
     else
     {
         this.CameraTransform = Camera.main.transform;
     }
     this.Sky       = base.GetComponent <TOD_Sky>();
     this.Animation = base.GetComponent <TOD_Animation>();
     this.Time      = base.GetComponent <TOD_Time>();
     this.Weather   = base.GetComponent <TOD_Weather>();
     this.Resources = base.GetComponent <TOD_Resources>();
     if (!this.Space)
     {
         Debug.LogError("Space reference not set. Disabling TOD_Sky script.");
         this.Sky.enabled = false;
         return;
     }
     this.SpaceRenderer   = this.Space.renderer;
     this.SpaceShader     = this.SpaceRenderer.sharedMaterial;
     this.SpaceMeshFilter = this.Space.GetComponent <MeshFilter>();
     if (!this.Atmosphere)
     {
         Debug.LogError("Atmosphere reference not set. Disabling TOD_Sky script.");
         this.Sky.enabled = false;
         return;
     }
     this.AtmosphereRenderer   = this.Atmosphere.renderer;
     this.AtmosphereShader     = this.AtmosphereRenderer.sharedMaterial;
     this.AtmosphereMeshFilter = this.Atmosphere.GetComponent <MeshFilter>();
     if (!this.Clear)
     {
         Debug.LogError("Clear reference not set. Disabling TOD_Sky script.");
         this.Sky.enabled = false;
         return;
     }
     this.ClearRenderer   = this.Clear.renderer;
     this.ClearShader     = this.ClearRenderer.sharedMaterial;
     this.ClearMeshFilter = this.Clear.GetComponent <MeshFilter>();
     if (!this.Clouds)
     {
         Debug.LogError("Clouds reference not set. Disabling TOD_Sky script.");
         this.Sky.enabled = false;
         return;
     }
     this.CloudRenderer   = this.Clouds.renderer;
     this.CloudShader     = this.CloudRenderer.sharedMaterial;
     this.CloudMeshFilter = this.Clouds.GetComponent <MeshFilter>();
     if (!this.Projector)
     {
         Debug.LogError("Projector reference not set. Disabling TOD_Sky script.");
         this.Sky.enabled = false;
         return;
     }
     this.ShadowProjector = this.Projector.GetComponent <UnityEngine.Projector>();
     this.ShadowShader    = this.ShadowProjector.material;
     if (!this.Light)
     {
         Debug.LogError("Light reference not set. Disabling TOD_Sky script.");
         this.Sky.enabled = false;
         return;
     }
     this.LightTransform = this.Light.transform;
     this.LightSource    = this.Light.light;
     if (!this.Sun)
     {
         Debug.LogError("Sun reference not set. Disabling TOD_Sky script.");
         this.Sky.enabled = false;
         return;
     }
     this.SunTransform  = this.Sun.transform;
     this.SunRenderer   = this.Sun.renderer;
     this.SunShader     = this.SunRenderer.sharedMaterial;
     this.SunMeshFilter = this.Sun.GetComponent <MeshFilter>();
     if (!this.Moon)
     {
         Debug.LogError("Moon reference not set. Disabling TOD_Sky script.");
         this.Sky.enabled = false;
         return;
     }
     this.MoonTransform  = this.Moon.transform;
     this.MoonRenderer   = this.Moon.renderer;
     this.MoonShader     = this.MoonRenderer.sharedMaterial;
     this.MoonMeshFilter = this.Moon.GetComponent <MeshFilter>();
 }
Example #53
0
 void Awake()
 {
     controller = GetComponent<CharacterController>();
     selectionBox = GetComponentInChildren<Projector>();
     line = GetComponent<LineRenderer>();
     sight = soldierSight.GetComponent<SoldierSight>();
     soldierManager = GameObject.FindGameObjectWithTag("GameController").GetComponent<SoldierManager>();
 }
Example #54
0
 static public int get_ignoreLayers(IntPtr l)
 {
     UnityEngine.Projector o = (UnityEngine.Projector)checkSelf(l);
     pushValue(l, o.ignoreLayers);
     return(1);
 }
Example #55
0
 static public int get_orthographicSize(IntPtr l)
 {
     UnityEngine.Projector o = (UnityEngine.Projector)checkSelf(l);
     pushValue(l, o.orthographicSize);
     return(1);
 }
Example #56
0
 static public int get_farClipPlane(IntPtr l)
 {
     UnityEngine.Projector o = (UnityEngine.Projector)checkSelf(l);
     pushValue(l, o.farClipPlane);
     return(1);
 }
Example #57
0
 static public int get_fieldOfView(IntPtr l)
 {
     UnityEngine.Projector o = (UnityEngine.Projector)checkSelf(l);
     pushValue(l, o.fieldOfView);
     return(1);
 }
Example #58
0
 /// <summary>
 /// Read the data using the reader.
 /// </summary>
 /// <param name="reader">Reader.</param>
 public override object Read(ISaveGameReader reader)
 {
     UnityEngine.Projector projector = SaveGameType.CreateComponent <UnityEngine.Projector> ();
     ReadInto(projector, reader);
     return(projector);
 }
Example #59
0
        /// <summary>
        /// Read the data into the specified value.
        /// </summary>
        /// <param name="value">Value.</param>
        /// <param name="reader">Reader.</param>
        public override void ReadInto(object value, ISaveGameReader reader)
        {
            UnityEngine.Projector projector = (UnityEngine.Projector)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "nearClipPlane":
                    projector.nearClipPlane = reader.ReadProperty <System.Single> ();
                    break;

                case "farClipPlane":
                    projector.farClipPlane = reader.ReadProperty <System.Single> ();
                    break;

                case "fieldOfView":
                    projector.fieldOfView = reader.ReadProperty <System.Single> ();
                    break;

                case "aspectRatio":
                    projector.aspectRatio = reader.ReadProperty <System.Single> ();
                    break;

                case "orthographic":
                    projector.orthographic = reader.ReadProperty <System.Boolean> ();
                    break;

                case "orthographicSize":
                    projector.orthographicSize = reader.ReadProperty <System.Single> ();
                    break;

                case "ignoreLayers":
                    projector.ignoreLayers = reader.ReadProperty <System.Int32> ();
                    break;

                case "material":
                    if (projector.material == null)
                    {
                        projector.material = reader.ReadProperty <UnityEngine.Material> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Material> (projector.material);
                    }
                    break;

                case "enabled":
                    projector.enabled = reader.ReadProperty <System.Boolean> ();
                    break;

                case "tag":
                    projector.tag = reader.ReadProperty <System.String> ();
                    break;

                case "name":
                    projector.name = reader.ReadProperty <System.String> ();
                    break;

                case "hideFlags":
                    projector.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }