static bool EmissionModule_SetBursts__Burst_Array__Int32(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 2)
        {
            UnityEngine.ParticleSystem.Burst[] arg0 = JSDataExchangeMgr.GetJSArg <UnityEngine.ParticleSystem.Burst[]>(() =>
            {
                int jsObjID = JSApi.getObject((int)JSApi.GetType.Arg);
                int length  = JSApi.getArrayLength(jsObjID);
                var ret     = new UnityEngine.ParticleSystem.Burst[length];
                for (var i = 0; i < length; i++)
                {
                    JSApi.getElement(jsObjID, i);
                    ret[i] = (UnityEngine.ParticleSystem.Burst)JSMgr.datax.getObject((int)JSApi.GetType.SaveAndRemove);
                }
                return(ret);
            });
            System.Int32 arg1 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
            UnityEngine.ParticleSystem.EmissionModule argThis = (UnityEngine.ParticleSystem.EmissionModule)vc.csObj;        argThis.SetBursts(arg0, arg1);
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
예제 #2
0
    // Use this for initialization

    public void Awake()
    {
        ParticleSystem = GetComponentInChildren<ParticleSystem>();
        _emissionModule = ParticleSystem.emission;
        ResetThis();
        ParticleSystem.gameObject.SetActive(false);
    }
 static public int constructor(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.ParticleSystem.EmissionModule o;
         o = new UnityEngine.ParticleSystem.EmissionModule();
         pushValue(l, true);
         pushValue(l, o);
         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
 }
    static void EmissionModule_burstCount(JSVCall vc)
    {
        UnityEngine.ParticleSystem.EmissionModule _this = (UnityEngine.ParticleSystem.EmissionModule)vc.csObj;
        var result = _this.burstCount;

        JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(result));
    }
예제 #5
0
    // Update is called once per frame
    void Update() {

        if (IsRender && !antRender) {

            for (int i = 0; i < particles.Length; i++)
            { 
                em = particles[i].emission;
                em.enabled = true;
            }

            antRender = true;
        }

        else if (!IsRender && antRender)
        {
            
            for (int i = 0; i < particles.Length; i++)
            {
                em = particles[i].emission;
                em.enabled = false;
            }

            antRender = false;
        }

	}
	private void Awake()
	{
        //Set rigid body
        m_RigidBodyComponent = GetComponent<Rigidbody>( );
		m_Robot = GetComponent<Robot> ();
        m_SmokeParticleSys = transform.FindChild( "RobotSmokeLeft" ).GetComponent<ParticleSystem>( );
        m_SmokeParticleEmit = m_SmokeParticleSys.emission;
	}
예제 #7
0
	// Use this for initialization
	void Start () {
		activeObjectList = new List<GameObject>();
		pushForce = new Vector2(0.0f, 0.0f);
		particles = gameObject.GetComponent<ParticleSystem>();
		emis = particles.emission;
		emis.enabled = false;
		particles.Play();
	}
예제 #8
0
    void Awake()
    {
        this.ParticleSystem = gameObject.GetComponentInChildren<ParticleSystem>();
        this.ParticleSystemEmit = this.ParticleSystem.emission;

        this.SpriteRed = Resources.Load<Sprite>("unlock/boutonStart");
        this.SpriteGreen = Resources.Load<Sprite>("unlock/boutonStartClic");
    }
예제 #9
0
파일: Entity.cs 프로젝트: Morac/CarThing3
    void Start()
    {
        Health = MaxHealth;
        fullEmissionRate = HealthFX.emission.rate.constantMax;

        emitModule = HealthFX.emission;
        emitModule.rate = new ParticleSystem.MinMaxCurve(0);
    }
예제 #10
0
    // Use this for initialization
    void Awake() {
        cam = Camera.main.transform;
        serverCube = GameObject.Find("ServerCube");
        clientCube = GameObject.Find("ClientCube");

        serverps = serverCube.GetComponent<ParticleSystem>().emission;
        clientps = clientCube.GetComponent<ParticleSystem>().emission;

    }
예제 #11
0
파일: Orb.cs 프로젝트: coderDarren/GGJ2016
	// Use this for initialization
	void Start () {
        player = GameObject.FindGameObjectWithTag("Player");
        currentTime = 0.0f;
        gainXp = false;
        system = GetComponent<ParticleSystem>();

        emission = system.emission;
        emission.SetBursts(new ParticleSystem.Burst[] { new ParticleSystem.Burst(2.0f, 100) });
        particles = new ParticleSystem.Particle[system.maxParticles];
    }
예제 #12
0
 // called my manager
 public void initialize(ProjectileManager manager, PType type) {
     mesh = transform.Find("Model").gameObject;
     col = GetComponent<Collider>();
     rb = GetComponent<Rigidbody>();
     psem = transform.Find("Particles").GetComponent<ParticleSystem>().emission;
     lightComp = GetComponent<Light>();
     this.manager = manager;
     this.type = type;
     freeze = false;
     reset();
 }
예제 #13
0
    void Awake()
    {
        ipAddress = Application.isEditor ? "192.168.0.103" : "192.168.0.105";
        cam = Camera.main.transform;
        serverCube = GameObject.Find("ServerCube");
        clientCube = GameObject.Find("ClientCube");

        keyPad = UnityEngine.Object.FindObjectOfType<IPKeyPad>();
        serverps = serverCube.GetComponent<ParticleSystem>().emission;
        clientps = clientCube.GetComponent<ParticleSystem>().emission;

    }
예제 #14
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystem.EmissionModule o;
         o = new UnityEngine.ParticleSystem.EmissionModule();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
예제 #15
0
 // Use this for initialization
 void Start () {
     playerHeart = GameObject.FindObjectOfType<PlayerHeart>();
     boomBitch = GetComponent<PointEffector2D>();
     fireAbilityParticle = GetComponent<ParticleSystem>();
     emission = fireAbilityParticle.emission;
     emission.enabled = false;
     boomBitch.enabled = false;
     firePlayer = GameObject.FindObjectOfType<Player>();
     fireBall = GameObject.FindObjectOfType<FireBall>();
     theGrad = fireAbilityParticle.colorOverLifetime;
     grads = GetComponent<FlickerGradients>();
 }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.ParticleSystem.EmissionModule o;
			o=new UnityEngine.ParticleSystem.EmissionModule();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
예제 #17
0
파일: Finish.cs 프로젝트: Badeye/impulse
        // Use this for initialization
        private void Start()
        {
            ps = GetComponentInChildren<ParticleSystem>();
            psEmit = ps.emission;
            ps.Stop();
            ps.gameObject.SetActive(false);

            finishLocation = (Vector2)this.gameObject.transform.position;
            //finishParticlesEmit = GetComponent<ParticleSystem>().emission;
            //finishParticlesEmit.enabled = false;

            Game.onGameStateChange.AddListener(GameStateChanged);
        }
    static int QPYX_get_emission_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        UnityEngine.ParticleSystem QPYX_obj_YXQP = (UnityEngine.ParticleSystem)QPYX_o_YXQP;
            UnityEngine.ParticleSystem.EmissionModule QPYX_ret_YXQP = QPYX_obj_YXQP.emission;
            ToLua.PushValue(L_YXQP, QPYX_ret_YXQP);
            return(1);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index emission on a nil value"));
        }
    }
////////////////////// EmissionModule ///////////////////////////////////////
// constructors

// fields

// properties
    static void EmissionModule_enabled(JSVCall vc)
    {
        if (vc.bGet)
        {
            UnityEngine.ParticleSystem.EmissionModule _this = (UnityEngine.ParticleSystem.EmissionModule)vc.csObj;
            var result = _this.enabled;
            JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result));
        }
        else
        {
            System.Boolean arg0 = (System.Boolean)JSApi.getBooleanS((int)JSApi.GetType.Arg);
            UnityEngine.ParticleSystem.EmissionModule _this = (UnityEngine.ParticleSystem.EmissionModule)vc.csObj;
            _this.enabled = arg0;
            JSMgr.changeJSObj(vc.jsObjID, _this);
        }
    }
 static void EmissionModule_type(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.ParticleSystem.EmissionModule _this = (UnityEngine.ParticleSystem.EmissionModule)vc.csObj;
         var result = _this.type;
         JSApi.setEnum((int)JSApi.SetType.Rval, (int)result);
     }
     else
     {
         UnityEngine.ParticleSystemEmissionType    arg0  = (UnityEngine.ParticleSystemEmissionType)JSApi.getEnum((int)JSApi.GetType.Arg);
         UnityEngine.ParticleSystem.EmissionModule _this = (UnityEngine.ParticleSystem.EmissionModule)vc.csObj;
         _this.type = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
 static void EmissionModule_rate(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.ParticleSystem.EmissionModule _this = (UnityEngine.ParticleSystem.EmissionModule)vc.csObj;
         var result = _this.rate;
         JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
     }
     else
     {
         UnityEngine.ParticleSystem.MinMaxCurve    arg0  = (UnityEngine.ParticleSystem.MinMaxCurve)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
         UnityEngine.ParticleSystem.EmissionModule _this = (UnityEngine.ParticleSystem.EmissionModule)vc.csObj;
         _this.rate = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
    static int get_emission(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.ParticleSystem obj = (UnityEngine.ParticleSystem)o;
            UnityEngine.ParticleSystem.EmissionModule ret = obj.emission;
            ToLua.PushValue(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index emission on a nil value"));
        }
    }
    static int get_emission(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.ParticleSystem.emission");
#endif
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.ParticleSystem obj = (UnityEngine.ParticleSystem)o;
            UnityEngine.ParticleSystem.EmissionModule ret = obj.emission;
            ToLua.PushValue(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index emission on a nil value"));
        }
    }
예제 #24
0
파일: TSMagic.cs 프로젝트: 3dAnon/PoniGame
    private void Start()
    {
        m_hornMagic.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;

        GameObject particles = Instantiate(m_particlePrefab, m_hornMagic.transform, false) as GameObject;
        ParticleSystem particleSystem = particles.GetComponent<ParticleSystem>();
        ParticleSystem.ShapeModule shape = particleSystem.shape;
        shape.meshRenderer = m_hornMagic;
        m_hornEmission = particleSystem.emission;

        float scale = m_hornMagic.bounds.extents.magnitude;
        m_baseEmissionRate = m_hornEmission.rate.constant * scale;
        m_hornMagic.material.SetFloat("_Displacement", m_hornMagic.material.GetFloat("_Displacement") * scale);
        m_hornMagic.material.SetFloat("_Amplitude", m_hornMagic.material.GetFloat("_Amplitude") * scale);
        m_hornMagic.material.SetFloat("_SpatialFrequency", m_hornMagic.material.GetFloat("_SpatialFrequency") / scale);

        m_hornMagicColor = m_magicColor;
        m_hornMagicColor.a = 0;
        m_emissionFraction = 0;
    }
예제 #25
0
    private IEnumerator ReplenishMalware()
    {
        particlesEmission = InstantiateParticles.emission;
        particlesEmission.rate = new ParticleSystem.MinMaxCurve(10f);
        yield return new WaitForSecondsInterruptTime(TimeToReplenishSingleMalware - 1);
        particlesEmission.rate = new ParticleSystem.MinMaxCurve(40f);
        yield return new WaitForSecondsInterruptTime(1f);
        DoReplenishMalware();
        particlesEmission.rate = new ParticleSystem.MinMaxCurve(0f);

        //if there are malware to create, recall this coroutine
        if (malwareQueue > 0)
        {
            Replenish = StartCoroutine(ReplenishMalware());
        }
        else
        {
            //otherwise null out this reference
            Replenish = null;
        }
    }
예제 #26
0
	protected void AwakeBaseClass()
	{
		dead = false;
		health = maxHealth;
		myCollider = GetComponent<Collider2D> ();

		GameObject craftsSix = new GameObject();
		craftsSix.transform.parent = this.transform;
		craftsSix.transform.position = this.transform.position + sixOclockPos;
		craftsSix.name = "Craft's Six";

		bloodSplashImage = GameObject.FindGameObjectWithTag ("Manager Tools").transform.FindChild 
			("Canvas (Effects, screen)/Blood Splash").GetComponent<Image>();

		if(healthSlider != null)
			healthSliderColour = healthSlider.GetComponentInChildren<Image> ();

		myAudioSource = GetComponent<AudioSource> ();

		smokeEm = smoke.emission;
		flamesEm = flames.emission;
	}
예제 #27
0
	public void Start() 
	{
		ps1 = GetComponent<ParticleSystem> ();
		em1 = ps1.emission;
		ps2 = GetComponent<ParticleSystem> ();
		em2 = ps2.emission;
		ps3 = GetComponent<ParticleSystem> ();
		em3 = ps3.emission;

		GameObject go = GameObject.Find("SocketIO");
		socket = go.GetComponent<SocketIOComponent>();
        
        txt = this.gameObject.GetComponent<Text>(); 

		socket.On("sendname", OnSendName);
		socket.On("twitter-stream", OnRandomyNumber);
		socket.On("welcome",OnWelcome);
		socket.On("error", TestError);
		socket.On("close", TestClose);
		socket.On ("presidential", OnPresidential);
		socket.On ("migrant", OnMigrant);
		socket.On ("poverty", OnPoverty);

	}
예제 #28
0
    public void Start()
    {
        //Init Unity particle system
        ps = GetComponent <UnityEngine.ParticleSystem>();
        var main = ps.main;

        main.startSize = Constants.Radius;
        emitter        = ps.emission;
        // add Unity Particle Renderer
        prenderer = GetComponent <ParticleSystemRenderer>();
        prenderer.material.color = new Color(1f, 1f, 1f, 1);
        defaultmat = prenderer.material;


        // find cam
        cam = GameObject.Find("Main Camera");
        // fps stuff
        timeleft = updateInterval;

        //init compute buffer
        particleBuffer = new ComputeBuffer(1000, Constants.SIZE_PARTICLE);
        gridBuffer     = new ComputeBuffer(fluidSim.m_grid.GPUVoxel, Constants.SIZE_GRID);
        grid[] gridArray = new grid[fluidSim.m_grid.GPUVoxel];
        fluidSim.m_grid.setUpGPUArray(gridArray);

        gridBuffer.SetData(gridArray);

        // Find the id of the kernel
#if UNITY_STANDALONE_OSX
        mComputeShaderKernelID = computeShader.FindKernel("computeMain");
#endif
#if UNITY_STANDALONE_WIN
        mComputeShaderKernelID = computeShader.FindKernel("CSMain");
                #endif
        computeShader.SetBuffer(mComputeShaderKernelID, "field", gridBuffer);
    }
예제 #29
0
    void Start()
    {
        this.ParticleSystem = gameObject.GetComponentInChildren<ParticleSystem>();
        this.ParticleSystemEmit = this.ParticleSystem.emission;
        //this.ContactPointLayer = GameObject.Find("ContactPointLayer").GetComponent<ContactPointLayer>();

        this.SpriteRed = Resources.Load<Sprite>("unlock/boutonStart");
        this.SpriteGreen = Resources.Load<Sprite>("unlock/boutonStartClic");
    }
예제 #30
0
	private void Awake() {
		snowParticles = GetComponent<ParticleSystem>();
		snowEmission = snowParticles.emission;
		snowEmission.enabled = false;
		snowParticles.Play();
	}
예제 #31
0
파일: Player.cs 프로젝트: don1989/Asteroids
    void Start()
    {
        // Constrain to x-y axis
        m_rigidBody = GetComponent<Rigidbody>();
        m_rigidBody.constraints = RigidbodyConstraints.FreezePositionZ;

        m_shootCooldownTimer = 0;

        ParticleSystem thrustParticleSystem = GetComponentInChildren<ParticleSystem>();
        if ( thrustParticleSystem )
        {
            m_thrustEmissions = thrustParticleSystem.emission;
            m_thrustEmissions.enabled = false;
        }
    }
예제 #32
0
 void Start()
 {
     Anim = GetComponent<Animator>();
     Rb2d = GetComponent<Rigidbody2D>();
     em = ColaBottleParticles.emission;
 }
예제 #33
0
 // Use this for initialization
 void Start () {
     //system = GetComponent<ParticleSystem>();
     emission = system.emission;
     system.Stop();
     
 }
예제 #34
0
    void Update()
    {
        // Update each pinch detector (one per hand)
        int index = 0;

        foreach (PinchDetector pd in pinchDetectors)
        {
            // Sets the fluid to the currently looped on fluid (mainly to save time refactoring code for the multi-hand support added)
            if (index == 0)
            {
                fluid = fluid1;
            }
            else
            {
                fluid = fluid2;
            }

            // Updates the fluids color based on user selection
            updateFluidColor();

            // Logic for painting
            float strength = pd.hand.GetLeapHand() != null?pd.hand.GetLeapHand().PinchStrength : 0f;

            float speed = pd.hand.GetLeapHand() != null?pd.hand.GetLeapHand().PalmVelocity.Magnitude : 0f;

            if (pd.DidStartHold)
            {
                if (fluidEnabled)
                {
                    // Spawns fluid at point
                    UnityEngine.ParticleSystem.EmissionModule em = fluid.GetComponent <ParticleSystem> ().emission;
                    em.enabled = true;

                    // Disable fluid collision
                    UnityEngine.ParticleSystem.CollisionModule mod = fluid.GetComponent <ParticleSystem> ().collision;
                    mod.enabled = false;

                    // Disable fluid gravity
                    fluid.GetComponent <ParticleSystem> ().gravityModifier = 0.0f;

                    Vector3 pos = pd.transform.position;
                    if (!inVr)
                    {
                        pos.y = -pos.y;
                    }
                    fluid.transform.position = pos;
                }
                else
                {
                    // Line stuff
                    paintLines [index].InitPaintLine();
                }
            }
            if (pd.DidRelease)
            {
                // Fluid stuff
                if (fluidEnabled)
                {
                    UnityEngine.ParticleSystem.EmissionModule em = fluid.GetComponent <ParticleSystem> ().emission;
                    em.enabled = false;
                }
                else
                {
                    // Line stuff
                    paintLines [index].EndPaintLine();
                }
            }
            if (pd.IsHolding)
            {
                if (fluidEnabled)
                {
                    // Fluid stuff
                    if (stencil == null || stencil.name == "Robot Kyle" || !snapping)
                    {
                        Vector3 pos = pd.Position;
                        if (!inVr)
                        {
                            pos.y = -pos.y;
                        }
                        fluid.transform.position = pos;
                    }
                    else
                    {
                        Vector3 pos = pd.Position;
                        if (!inVr)
                        {
                            pos.y = -pos.y;
                        }
                        Vector3 nearest = NearestVertexTo(pos, stencil);
                        fluid.transform.position = nearest;
                    }
                }
                else
                {
                    // Line stuff
                    if (stencil == null || stencil.name == "Robot Kyle" || !snapping)
                    {
                        paintLines[index].UpdatePaintLine(pd.Position, strength, speed);
                    }
                    else
                    {
                        paintLines[index].UpdatePaintLine(NearestVertexTo(pd.Position, stencil), strength, speed);
                    }
                }
            }
            index++;
        }
    }
	// 
	void Start () {
		ps = GetComponent<ParticleSystem>();
		em = ps.emission;

	}
예제 #36
0
 void Start()
 {
     _emission = _particleSystem.emission;
 }
    // Process component once per frame
    protected virtual void Update()
    {
        if (particles == null)
        {
            if (intrinsicParticles != null && intrinsicParticles.Length != 0)
            {
                particles = new ParticleSystem.Particle[intrinsicParticles.Length];
                if (particles != null && particles.Length == intrinsicParticles.Length)
                {
                    for (int position = 0; position < intrinsicParticles.Length; ++position)
                    {
                        particles[position].angularVelocity   = intrinsicParticles[position].angularVelocity;
                        particles[position].axisOfRotation    = intrinsicParticles[position].axisOfRotation;
                        particles[position].startColor        = intrinsicParticles[position].color;
                        particles[position].remainingLifetime = intrinsicParticles[position].lifetime;
                        particles[position].position          = intrinsicParticles[position].position;
                        particles[position].rotation          = intrinsicParticles[position].rotation;
                        particles[position].startSize         = intrinsicParticles[position].size;
                        particles[position].startLifetime     = intrinsicParticles[position].startLifetime;
                        particles[position].velocity          = intrinsicParticles[position].velocity;
                    }
                }
            }
            else
            {
                ParticleSystem particleSystem = GetComponent <ParticleSystem>();
                if (particleSystem != null)
                {
                    particles = new ParticleSystem.Particle[particleSystem.particleCount];
                    if (particles != null)
                    {
                        particleSystem.GetParticles(particles);
                    }
                }
            }
        }

        if (particles != null && particles.Length != 0)
        {
            ParticleSystem particleSystem = GetComponent <ParticleSystem>();
            if (particleSystem != null)
            {
                UnityEngine.ParticleSystem.EmissionModule emission = particleSystem.emission;

                emission.enabled = false;
                particleSystem.Stop();
                particleSystem.SetParticles(particles, particles.Length);

                particleSystem.startSize = 100.0f;
            }

            if (intrinsicParticles == null || intrinsicParticles.Length == 0)
            {
                intrinsicParticles = new Particle[particles.Length];
                if (intrinsicParticles != null && intrinsicParticles.Length == particles.Length)
                {
                    for (int position = 0; position < particles.Length; ++position)
                    {
                        intrinsicParticles[position].angularVelocity = particles[position].angularVelocity;
                        intrinsicParticles[position].axisOfRotation  = particles[position].axisOfRotation;
                        intrinsicParticles[position].color           = particles[position].startColor;
                        intrinsicParticles[position].lifetime        = particles[position].remainingLifetime;
                        intrinsicParticles[position].position        = particles[position].position;
                        intrinsicParticles[position].rotation        = particles[position].rotation;
                        intrinsicParticles[position].size            = particles[position].startSize;
                        intrinsicParticles[position].startLifetime   = particles[position].startLifetime;
                        intrinsicParticles[position].velocity        = particles[position].velocity;
                    }
                }
            }
        }
    }
예제 #38
0
 private void Awake()
 {
     thisBoxCollider = GetComponent<BoxCollider> ();
     psemit = particles.emission;
     skidSound = GetComponent<AudioSource> ();
 }
 // Use this for initialization
 void Start()
 {
     //sound functions
     sGunBank = GunsBank.S.sGunBank;
     sHitBank = HitsBank.S.sHitBank;
     guns = GameObject.FindGameObjectWithTag("GunMgr").GetComponents<AudioSource>();  //for more polyphony, add AudioSource componentes to the Gun or Hit bank prefabs
     hits = GameObject.FindGameObjectWithTag("HitMgr").GetComponents<AudioSource>();
     accTime = 0;
     accTime2 = effectDuration;
     shooting = false;
     shotEffects = false;
     shotParticles = gunParticles.emission;
     shotParticles.enabled = false;
     gunParticles.Play ();
     playerMask = LayerMask.GetMask ("Player");
 }
예제 #40
0
 void Start()
 {
   _timeDelta = period;
   _timeAtLastFrame = - startPhase * period;
   _em = system.emission;
 }
예제 #41
0
	// Use this for initialization
	void Start () {

		hitParticle = GetComponent<ParticleSystem>();
		hitParticleEmit = hitParticle.emission;

	}
예제 #42
0
	// Use this for initialization
	void Start () {
        ps = GetComponent<ParticleSystem>().emission;
        aud = GetComponent<AudioSource>();
        //statRend = statueHead.GetComponent<Renderer>();
	}
예제 #43
0
	public void Start()
	{
		musicMaster = FindObjectOfType<MusicMaster>();

		var particleSystems = GetComponentsInChildren<ParticleSystem>();
		var psDict = particleSystems.ToDictionary(ps => ps.gameObject.name, ps => ps.emission);

		if (psDict.ContainsKey("particles")) Emitter = psDict["particles"];
		if (psDict.ContainsKey("burning")) BurnEmitter = psDict["burning"];
		if (psDict.ContainsKey("fire")) FireEmitter = psDict["fire"];

		progressImage = Instantiate(progressImagePrefab);
		progressImage.GetComponent<Image>().color = Color.blue;
		var canvas = FindObjectOfType<Canvas>();
		progressImage.transform.SetParent(canvas.transform);

		SpatulaIdlePosition = Spatula.transform.position;
		SpatulaIdleRotation = Spatula.transform.eulerAngles;

        //Face stir indicator to camera on start (must be this direction for rotation to be right!!)
        StirIndicator.transform.forward = Camera.main.transform.forward;
    }