Inheritance: Behaviour
Beispiel #1
0
    void Start()
    {
        brightcoef = 1;
        starttime = Time.time;
        lighti = GetComponent<Light>();
        theflare = GetComponent<LensFlare>();
        thetrans = transform;

        ColorWanted = new Vector3(255, 255, 255);
        lighti.color = guitools.RGB(ColorWanted.x, ColorWanted.y, ColorWanted.z);
        theflare.color = guitools.RGB(ColorWanted.x, ColorWanted.y, ColorWanted.z);
        CurrentColor = ColorWanted;

        if (delay > houreees / 4f && delay < houreees / 3f)
        {
            ColorWanted = 255* new Vector3(Morning.r, Morning.g, Morning.b);
            print("A");
        }
        if (delay > houreees / 3f && delay < (houreees * 3 / 4f - houreees / 12f))
        {
            ColorWanted = 255 * new Vector3(Day.r, Day.g, Day.b);
            print("B");
        }
        if (delay > (houreees * 3 / 4f - houreees / 12f) && delay < houreees * 3 / 4f)
        {
            ColorWanted = 255 * new Vector3(Night.r, Night.g, Night.b);
            print("C");
        }

        lighti.color = guitools.RGB(ColorWanted.x, ColorWanted.y, ColorWanted.z);
        CurrentColor = ColorWanted;


        StartCoroutine(suni(angle,delay));
    }
 static public int constructor(IntPtr l)
 {
     UnityEngine.LensFlare o;
     o = new UnityEngine.LensFlare();
     pushObject(l, o);
     return(1);
 }
	// Use this for initialization
	void Start ()
	{
		strength = 3500f;
        lensFlare = GetComponent<LensFlare>();
		Vector3 heading = gameObject.transform.position - Camera.main.transform.position;
		float dist = heading.magnitude;
        lensFlare.brightness = strength / dist;
	}
 static public int set_color(IntPtr l)
 {
     UnityEngine.LensFlare o = (UnityEngine.LensFlare)checkSelf(l);
     UnityEngine.Color     v;
     checkType(l, 2, out v);
     o.color = v;
     return(0);
 }
    // Use this for initialization
    void Start()
    {
        Transform mychildtransform = transform.FindChild("Point light");
        light = mychildtransform.gameObject;

        flare = light.GetComponent<LensFlare>();
        gameObject.GetComponent<Enemy_PlayerAttacking>().OnAttackingPlayer += OnAttackingPlayer;
    }
 static public int set_flare(IntPtr l)
 {
     UnityEngine.LensFlare o = (UnityEngine.LensFlare)checkSelf(l);
     UnityEngine.Flare     v;
     checkType(l, 2, out v);
     o.flare = v;
     return(0);
 }
    private float timer = 0; //timer for decaylight

    #endregion Fields

    #region Methods

    // Use this for initialization
    void Start()
    {
        rigidbody = GetComponent<Rigidbody>();
        lightObject = gameObject.GetComponentInChildren<Light>();
        flareLens = lightObject.GetComponent<LensFlare>();

        rigidbody.velocity = transform.right * speed;
        Destroy(gameObject, destroyTime);
    }
Beispiel #8
0
 // Use this for initialization
 void Start()
 {
     theCanon = transform.parent.GetComponent<Canon>();
     pointLight = transform.FindChild("Light").light;
     lensFlare = transform.GetComponentInChildren<LensFlare>();
     ps = transform.FindChild("PS").particleSystem;
     time = 0f;
     if(!Application.loadedLevelName.Contains("Editor") && !Application.loadedLevelName.Contains("MainMenu") ) gameplay = GameObject.Find("Engine").GetComponent<Gameplay>();
 }
    static public int set_brightness(IntPtr l)
    {
        UnityEngine.LensFlare o = (UnityEngine.LensFlare)checkSelf(l);
        float v;

        checkType(l, 2, out v);
        o.brightness = v;
        return(0);
    }
    static public int set_fadeSpeed(IntPtr l)
    {
        UnityEngine.LensFlare o = (UnityEngine.LensFlare)checkSelf(l);
        float v;

        checkType(l, 2, out v);
        o.fadeSpeed = v;
        return(0);
    }
Beispiel #11
0
	// Use this for initialization
	void Start () {
		// get all the objects we'll need for the cutscene 
		//FlyingBBall = GameObject.Find ("Flying Basketball");
		ScreenFlash = GameObject.Find ("ScreenFlash").GetComponent<ScreenFlasher>();
		ExplosionFlare = GameObject.Find ("Explosion_Flare").GetComponent<LensFlare>();
		SparkParticles = GameObject.Find ("SparkParticles").GetComponent<ParticleSystem>();

		mus = GameObject.Find ("BGM").GetComponent<MusicPlayer>();
		bc = GetComponent<BattleController>();

	}
Beispiel #12
0
 static public int get_fadeSpeed(IntPtr l)
 {
     try {
         UnityEngine.LensFlare self = (UnityEngine.LensFlare)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.fadeSpeed);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 /// <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.LensFlare lensFlare = (UnityEngine.LensFlare)value;
     writer.WriteProperty("flare", lensFlare.flare);
     writer.WriteProperty("brightness", lensFlare.brightness);
     writer.WriteProperty("fadeSpeed", lensFlare.fadeSpeed);
     writer.WriteProperty("color", lensFlare.color);
     writer.WriteProperty("enabled", lensFlare.enabled);
     writer.WriteProperty("tag", lensFlare.tag);
     writer.WriteProperty("name", lensFlare.name);
     writer.WriteProperty("hideFlags", lensFlare.hideFlags);
 }
 static public int get_fadeSpeed(IntPtr l)
 {
     try {
         UnityEngine.LensFlare self = (UnityEngine.LensFlare)checkSelf(l);
         pushValue(l, self.fadeSpeed);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.LensFlare o;
			o=new UnityEngine.LensFlare();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.LensFlare o;
         o=new UnityEngine.LensFlare();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.LensFlare o;
         o = new UnityEngine.LensFlare();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Beispiel #18
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.LensFlare o;
         o = new UnityEngine.LensFlare();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int constructor(IntPtr l)
 {
     LuaDLL.lua_remove(l, 1);
     UnityEngine.LensFlare o;
     if (matchType(l, 1))
     {
         o = new UnityEngine.LensFlare();
         pushObject(l, o);
         return(1);
     }
     LuaDLL.luaL_error(l, "New object failed.");
     return(0);
 }
Beispiel #20
0
 private void Start()
 {
     flare = GetComponent<LensFlare>();
     startPos = transform.position;
     starMat = GetComponent<Renderer>().material;
     trailMat = GetComponent<TrailRenderer>().material;
     starMat.SetFloat("_Transparency", 0.0f);
     trailMat.SetFloat("_Transparency", 0.0f);
     flare.brightness = minFlareBrightness;
     tr = gameObject.GetComponent<TrailRenderer>();
     origTrailTime = tr.time;
     maxValues = new AnimationParameters() { scale = maxScale, starTransparency = 1.0f, trailTransparency = 1.0f, flareBrightness = maxFlareBrightness };
     minValues = new AnimationParameters() { scale = minScale, starTransparency = 0.0f, trailTransparency = 0.0f, flareBrightness = minFlareBrightness };
 }
Beispiel #21
0
 static public int set_fadeSpeed(IntPtr l)
 {
     try {
         UnityEngine.LensFlare self = (UnityEngine.LensFlare)checkSelf(l);
         float v;
         checkType(l, 2, out v);
         self.fadeSpeed = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_fadeSpeed(IntPtr l)
 {
     try {
         UnityEngine.LensFlare self = (UnityEngine.LensFlare)checkSelf(l);
         float v;
         checkType(l, 2, out v);
         self.fadeSpeed = v;
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Beispiel #23
0
 static public int set_color(IntPtr l)
 {
     try {
         UnityEngine.LensFlare self = (UnityEngine.LensFlare)checkSelf(l);
         UnityEngine.Color     v;
         checkType(l, 2, out v);
         self.color = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static void LensFlare_color(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.LensFlare _this = (UnityEngine.LensFlare)vc.csObj;
         var result = _this.color;
         JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
     }
     else
     {
         UnityEngine.Color     arg0  = (UnityEngine.Color)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
         UnityEngine.LensFlare _this = (UnityEngine.LensFlare)vc.csObj;
         _this.color = arg0;
     }
 }
 static void LensFlare_fadeSpeed(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.LensFlare _this = (UnityEngine.LensFlare)vc.csObj;
         var result = _this.fadeSpeed;
         JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(result));
     }
     else
     {
         System.Single         arg0  = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
         UnityEngine.LensFlare _this = (UnityEngine.LensFlare)vc.csObj;
         _this.fadeSpeed = arg0;
     }
 }
        /// <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.LensFlare lensFlare = (UnityEngine.LensFlare)value;
            foreach (string property in reader.Properties)
            {
                switch (property)
                {
                case "flare":
                    if (lensFlare.flare == null)
                    {
                        lensFlare.flare = reader.ReadProperty <UnityEngine.Flare> ();
                    }
                    else
                    {
                        reader.ReadIntoProperty <UnityEngine.Flare> (lensFlare.flare);
                    }
                    break;

                case "brightness":
                    lensFlare.brightness = reader.ReadProperty <System.Single> ();
                    break;

                case "fadeSpeed":
                    lensFlare.fadeSpeed = reader.ReadProperty <System.Single> ();
                    break;

                case "color":
                    lensFlare.color = reader.ReadProperty <UnityEngine.Color> ();
                    break;

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

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

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

                case "hideFlags":
                    lensFlare.hideFlags = reader.ReadProperty <UnityEngine.HideFlags> ();
                    break;
                }
            }
        }
    // Use this for initialization
    void Start()
    {
        animation["GeneratorAnimation"].speed = 0;
        animation.wrapMode = WrapMode.Loop;

        Transform mychildtransform = transform.FindChild("Point light");
        light = mychildtransform.gameObject;

        flare = light.GetComponent<LensFlare>();

        particleSys = transform.FindChild("Particle System").gameObject.particleSystem;

        if (associatedSwitch != null)
        {
            associatedSwitch.GetComponent<Generator_Switch_Controller>().OnActivateGeneratorSwitch += OnActivateSwitch;
        }
    }
	// Use this for initialization
	void Start () {
		flare = GetComponent<LensFlare>();
	}
Beispiel #29
0
    void Start()
    {
        m_spriteBuilder = GetComponentInChildren<SpriteBuilder> ();
        m_spriteBuilder.Build ();

        m_spriteDestruction = GetComponentInChildren<SpriteDestruction> ();
        m_collider = GetComponent<BoxCollider2D> ();

        m_audioSource = GetComponent<AudioSource> ();
        m_lensFlare = GetComponent<LensFlare> ();
        m_trail = GetComponentInChildren<TrailRenderer> ();

        StartCoroutine (Deploy ());
    }
 static public int get_brightness(IntPtr l)
 {
     UnityEngine.LensFlare o = (UnityEngine.LensFlare)checkSelf(l);
     pushValue(l, o.brightness);
     return(1);
 }
Beispiel #31
0
 private void Awake()
 {
     omega = Random.Range(minOmega, maxOmega);
     light.range = Settings.DimensionScaleFactor;
     flare = GetComponent<LensFlare>();
 }
 // Use this for initialization
 void Start()
 {
     moving = true;
     flare = gameObject.GetComponent<LensFlare>();
 }
Beispiel #33
0
    void Start()
    {
        //Stores level spawners in hierarchy
        spawnerParent = GameObject.Find("Spawners").transform.FindChild("LevelSpawners").transform;

        //Used to animate a flash
        flash = GameObject.Find("Flash").GetComponent<LensFlare>();

        wallParent = GameObject.Find("Walls").transform;
        walls = wallParent.GetComponentsInChildren<Wall>();
        lava = FindObjectOfType<Lava>();
        sunAnimator = FindObjectOfType<Sun>().GetComponent<Animator>();

        overlay1 = new Overlay(GameObject.Find("Overlay").transform);
        overlay2 = new Overlay(GameObject.Find("Overlay2").transform);

        //Set up and Start level 0
        SetUpLevel();
        PlayLevel();
    }
 static public int get_color(IntPtr l)
 {
     UnityEngine.LensFlare o = (UnityEngine.LensFlare)checkSelf(l);
     pushValue(l, o.color);
     return(1);
 }
Beispiel #35
0
 // Use this for initialization
 void Start()
 {
     flare = GetComponent<LensFlare>();
     startBrightness = flare.brightness;
 }
Beispiel #36
0
 // Use this for initialization
 void Start()
 {
     Swift = gameObject.GetComponent<LensFlare>();
     InvokeRepeating ("flashing",0,.075f);
 }
 static public int get_fadeSpeed(IntPtr l)
 {
     UnityEngine.LensFlare o = (UnityEngine.LensFlare)checkSelf(l);
     pushValue(l, o.fadeSpeed);
     return(1);
 }
Beispiel #38
0
 // Use this for initialization
 void Start()
 {
     state = GameState.Instance;
     l = GetComponent<Light>();
     flare = GetComponent<LensFlare>();
 }
 /// <summary>
 /// Read the data using the reader.
 /// </summary>
 /// <param name="reader">Reader.</param>
 public override object Read(ISaveGameReader reader)
 {
     UnityEngine.LensFlare lensFlare = SaveGameType.CreateComponent <UnityEngine.LensFlare> ();
     ReadInto(lensFlare, reader);
     return(lensFlare);
 }
Beispiel #40
0
	protected void Initialize ()
	{
		oldShapeLength = shapeLength;

		bool anyLights = false;

		for(int n = 0; n < arcs.Length; n++)
		{
			//Particle emitter initialization
			for (int q = 0; q < arcs[n].emissionOptions.Length; q++)
			{
				if (emitterSystems[n][q] == null && arcs[n].emissionOptions[q].shurikenPrefab != null)
				{
					GameObject partGameObject = (GameObject)GameObject.Instantiate(arcs[n].emissionOptions[q].shurikenPrefab);
					partGameObject.name = "EmitterObject "+gameObject.name+" "+n.ToString()+","+q.ToString();
					emitterSystems[n][q] = partGameObject.GetComponent<ParticleSystem>();
					if (emitterSystems[n][q].enableEmission)
						emitterSystems[n][q].enableEmission = false;
					if (!arcs[n].emissionOptions[q].emitAfterRayDeath)
						partGameObject.transform.parent = transform;
					else
					{
						emitterDestructors[n][q] = partGameObject.AddComponent<ArcReactor_EmitterDestructor>();
						emitterDestructors[n][q].partSystem = emitterSystems[n][q];
						emitterDestructors[n][q].enabled = false;
					}
					partGameObject.transform.position = transform.position;
					partGameObject.transform.rotation = transform.rotation;
				}
			}


			//Lights initialization
			if (arcs[n].lightsOptions.lights)
			{
				for (int i = 0; i < lightsCount[n]; i++)
				{
					Destroy(lights[n,i].gameObject);
				}
			}
			anyLights |= arcs[n].lightsOptions.lights;
			lightsCount[n] = Mathf.Max ((int)(shapeLength * 2 / arcs[n].lightsOptions.lightsRange + 1),2);

			//Segment and vertex initialization
			segmNums[n] = Mathf.Max((int)(shapeLength / (arcs[n].sizeOptions.segmentLength * sizeMultiplier))+arcs[n].sizeOptions.minNumberOfSegments,2);			
			vertexCount[n] = segmNums[n]*(arcs[n].sizeOptions.numberOfSmoothingSegments+1)+1;
			oldVertexCount[n] = vertexCount[n];
			oldVertices[n] = new Vector3[vertexCount[n]];
			vertices[n] = new Vector3[vertexCount[n]];
			lrends[n].SetVertexCount(vertexCount[n]);

			//Flares placing
			if (arcs[n].flaresOptions.startFlare.enabled && startFlare == null)
			{
				GameObject obj = new GameObject(gameObject.name + "_Start_flare");
				obj.transform.parent = transform;
				startFlare = obj.gameObject.AddComponent<LensFlare>();
				startFlare.flare = arcs[n].flaresOptions.startFlare.flare;
				startFlare.fadeSpeed = arcs[n].flaresOptions.startFlare.fadeSpeed;
			}
			if (arcs[n].flaresOptions.endFlare.enabled && endFlare == null)
			{
				GameObject obj = new GameObject(gameObject.name + "_End_flare");
				obj.transform.parent = transform;
				endFlare = obj.gameObject.AddComponent<LensFlare>();
				endFlare.flare = arcs[n].flaresOptions.endFlare.flare;
				endFlare.fadeSpeed = arcs[n].flaresOptions.endFlare.fadeSpeed;
			}

		}

		//vertices = new Vector3[arcs.Length,vertexCount.Max()];
		arcPoints = new Vector3[arcs.Length,segmNums.Max()+2];
		shiftVectors = new Vector3[arcs.Length,segmNums.Max()+2];
		arcTangents = new Vector3[arcs.Length,segmNums.Max()+2];
		arcTangentsShift = new Quaternion[arcs.Length,segmNums.Max()*2+2];

		for (int n = 0; n < arcs.Length; n++)
		{
			ResetArc(n);
		}

		if (anyLights)
		{
			GameObject lightObject;
			lights = new Light[arcs.Length,lightsCount.Max()];
			lightsTransforms = new Transform[arcs.Length,lightsCount.Max()+1];
			for(int n = 0; n < arcs.Length; n++)
			{			
				if (arcs[n].lightsOptions.lights)
				{
					for (int i = 0; i < lightsCount[n]; i++)
					{
						lightObject = new GameObject("ArcLight");
						lightObject.transform.parent = transform;
						lightsTransforms[n,i] = lightObject.transform;
						lights[n,i] = lightObject.AddComponent<Light>();
						lights[n,i].type = LightType.Point;
						lights[n,i].renderMode = arcs[n].lightsOptions.renderMode;
						lights[n,i].range = arcs[n].lightsOptions.lightsRange;
					}
				}
			}
		}
	}
    void Start()
    {
        _flare = GetComponent<LensFlare> ();
        _light = GetComponentInChildren<Light> ();
        shooter = FindObjectOfType<HeroShooter> ();

        _flareBrightness = _flare.brightness;
        playerHealth = FindObjectOfType<ProfundumPlayerHealth> ();
    }
Beispiel #42
0
 void Start()
 {
     FlareComponent = GetComponent<LensFlare>();
 }
    static int _CreateLensFlare(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            LensFlare obj = new LensFlare();
            LuaScriptMgr.Push(L, obj);
            return 1;
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: LensFlare.New");
        }

        return 0;
    }
Beispiel #44
0
    // Use this for initialization
    void Awake()
    {
        // keep player along levels
        mBoltParticleManager = GetComponents<ParticleManager>()[1];
        mPickupTextManager = GetComponents<ParticleManager>()[0];
        // init compoments
        mRb = GetComponent<Rigidbody>();
        mAntenLensFlare = GetComponentInChildren<LensFlare>();
        mAni = transform.Find ("Chubby_Hover").GetComponent<Animator> ();
        mMovementControls = new MovementControls(this);
        mDash = transform.Find("Burst_Trail").gameObject;

        skinnedMeshRenderer = GetComponentsInChildren<SkinnedMeshRenderer>().Where(x => x.name != "Backpack").ToArray();

        mDownSwipeSound = AudioManager.Instance.GetSoundsEvent("DownSwipe/DownSwipe", true, 4);
        mHurtHitSound = AudioManager.Instance.GetSoundsEvent("TakeDamage/TakeDamage", true, 3);
        mCoinPickUpSound = AudioManager.Instance.GetSoundsEvent("ScewsPling/ScrewsPling", true, 4);
        mInflateSound = AudioManager.Instance.GetSoundsEvent("Inflate/Inflate", true, 4);
        mDeflateSound = AudioManager.Instance.GetSoundsEvent("Deflate/Deflate", true, 4);
        mInflateSound.mVolume = 100;
        mDeflateSound.mVolume = 100;

        transform.position = Vector3.zero;
    }
 private void Awake()
 {
     _flare = GetComponent<LensFlare>();
 }