public void SetBeamParam(BeamParam param)
 {
     this.BeamColor    = param.BeamColor;
     this.AnimationSpd = param.AnimationSpd;
     this.Scale        = param.Scale;
     this.MaxLength    = param.MaxLength;
 }
Example #2
0
	public void SetBeamParam(BeamParam param)
	{
		this.BeamColor = param.BeamColor;
		this.AnimationSpd = param.AnimationSpd;
		this.Scale = param.Scale;
		this.MaxLength = param.MaxLength;
	}
 public void SetBeamParam(BeamParam param)
 {
     BeamColor    = param.BeamColor;
     AnimationSpd = param.AnimationSpd;
     Scale        = param.Scale;
     MaxLength    = param.MaxLength;
 }
Example #4
0
    void Start()
    {
        BeamParam bp = GameObject.Find("Shooter").GetComponent <BeamParam>();

        bp.BeamColor.r = 1.1f;
        bp.BeamColor.g = 0.1f;
        bp.BeamColor.b = 0.1f;
    }
Example #5
0
    void Start()
    {
        BeamParam bp = GetComponent <BeamParam>();

        bp.BeamColor.r = 1.1f;
        bp.BeamColor.g = 0.1f;
        bp.BeamColor.b = 0.1f;

        NowShot     = null;
        m_playerMan = transform.parent.GetComponentInParent <PlayerManager>();
    }
    // Use this for initialization
    void Start()
    {
        BeamParam      bp = this.transform.root.gameObject.GetComponentInChildren <BeamParam>();
        SpriteRenderer sr = this.gameObject.GetComponent <SpriteRenderer>();

        sr.color = bp.BeamColor;
        Light li = this.gameObject.GetComponent <Light>();

        li.color  = bp.BeamColor;
        li.range *= bp.Scale;
    }
Example #7
0
    void Awake()
    {
        BeamParam param = this.transform.root.gameObject.GetComponentInChildren <BeamParam>();

        if (param != null)
        {
            this.BeamColor    = param.BeamColor;
            this.AnimationSpd = param.AnimationSpd;
            this.Scale        = param.Scale;
            this.MaxLength    = param.MaxLength;
        }
    }
    void Start()
    {
        BeamParam param = GetComponent <BeamParam>();

        if (param != null)
        {
            this.BeamColor    = param.BeamColor;
            this.AnimationSpd = param.AnimationSpd;
            this.Scale        = param.Scale;
            this.MaxLength    = param.MaxLength;
        }
    }
    void Update()
    {
        GameObject Bullet;

        //create BasicBeamShot
        if (Input.GetButtonDown("Fire1"))
        {
            Bullet = Shot1;
            //Fire
            GameObject s1 = (GameObject)Instantiate(Bullet, this.transform.position, this.transform.rotation);
            s1.GetComponent <BeamParam>().SetBeamParam(this.GetComponent <BeamParam>());

            GameObject wav = (GameObject)Instantiate(Wave, this.transform.position, this.transform.rotation);
            wav.transform.localScale *= 0.25f;
            wav.transform.Rotate(Vector3.left, 90.0f);
            wav.GetComponent <BeamWave>().col = this.GetComponent <BeamParam>().BeamColor;
        }


        //create GeroBeam
        if (Input.GetButtonDown("Fire2"))
        {
            GameObject wav = (GameObject)Instantiate(Wave, this.transform.position, this.transform.rotation);
            wav.transform.Rotate(Vector3.left, 90.0f);
            wav.GetComponent <BeamWave>().col = this.GetComponent <BeamParam>().BeamColor;

            Bullet = Shot2;
            //Fire
            NowShot = (GameObject)Instantiate(Bullet, this.transform.position, this.transform.rotation);
        }
        //it's Not "GetButtonDown"
        if (Input.GetButton("Fire2"))
        {
            BeamParam bp = this.GetComponent <BeamParam>();
            if (NowShot.GetComponent <BeamParam>().bGero)
            {
                NowShot.transform.parent = transform;
            }

            Vector3 s = new Vector3(bp.Scale, bp.Scale, bp.Scale);

            NowShot.transform.localScale = s;
            NowShot.GetComponent <BeamParam>().SetBeamParam(bp);
        }
        if (Input.GetButtonUp("Fire2"))
        {
            if (NowShot != null)
            {
                NowShot.GetComponent <BeamParam>().bEnd = true;
            }
        }
    }
Example #10
0
    void Start()
    {
        BeamParam param = this.transform.root.gameObject.GetComponent <BeamParam>();

        if (param != null)
        {
            this.BeamColor    = param.BeamColor;
            this.AnimationSpd = param.AnimationSpd;
            this.Scale        = param.Scale;
            this.MaxLength    = param.MaxLength;
            this.hitForce     = param.hitForce;
        }
    }
Example #11
0
    void Start()
    {
        BeamParam param = this.transform.root.gameObject.GetComponent <BeamParam>();

        if (param != null)
        {
            this.BeamColor    = param.BeamColor;
            this.AnimationSpd = param.AnimationSpd;
            this.Scale        = param.Scale;
            this.MaxLength    = param.MaxLength;
        }
        StartCoroutine(EndBeamIn(bEndTime));
    }
Example #12
0
    //it's Not "GetButtonDown"
    public void BasicGeroBeamAttack()
    {
        setSpawn();
        BeamParam bp = this.GetComponent <BeamParam>();

        if (NowShot.GetComponent <BeamParam>().bGero)
        {
            NowShot.transform.parent = transform;
        }

        Vector3 s = new Vector3(bp.Scale, bp.Scale, bp.Scale);

        NowShot.transform.localScale = s;
        NowShot.GetComponent <BeamParam>().SetBeamParam(bp);
    }
Example #13
0
    void Start () {
		BP = GetComponent<BeamParam>();
		LRSize = 16;
		NowLength = 0.0f;
		LR = GetComponent<LineRenderer>();
		HitObj = transform.FindChild("GeroBeamHit").GetComponent<GeroBeamHit>();
        SHP_Emitter = transform.FindChild("ShotParticle_Emitter").GetComponent<ShotParticleEmitter>();
        Flash = transform.FindChild("BeamFlash").gameObject;
        F_Vec = new Vector3[LRSize+1];
        FlashSize = Flash.transform.localScale.x;

        for (int i=0;i < LRSize+1;i++)
		{
			F_Vec[i] = transform.forward;
		}
	}
    // Use this for initialization
    void Start()
    {
        BeamParam Parent = this.transform.root.gameObject.GetComponent <BeamParam>();

        if (Parent == null)
        {
            return;
        }
        BeamLine BL = this.gameObject.GetComponent <BeamLine>();

        BL.BeamColor = Parent.BeamColor;

        BL.StartSize    = Parent.Scale * 0.5f;
        BL.AnimationSpd = Parent.AnimationSpd;
        BL.MaxLength    = Parent.MaxLength;
    }
Example #15
0
 // Use this for initialization
 void Start()
 {
     BP          = GetComponent <BeamParam>();
     NowLength   = 0.0f;
     LR          = this.GetComponent <LineRenderer>();
     HitObj      = this.transform.FindChild("GeroBeamHit").GetComponent <GeroBeamHit>();
     HitObjSize  = HitObj.transform.localScale;
     SHP_Emitter = this.transform.FindChild("ShotParticle_Emitter").GetComponent <ShotParticleEmitter>();
     Flash       = this.transform.FindChild("BeamFlash").gameObject;
     F_Vec       = new Vector3[positionSize + 1];
     FlashSize   = Flash.transform.localScale.x;
     for (int i = 0; i < positionSize + 1; i++)
     {
         F_Vec[i] = transform.forward;
     }
 }
Example #16
0
    // Update is called once per frame
    void Update()
    {
        BeamParam bp = GameObject.Find("Shooter").GetComponent <BeamParam>();

        //Anm
        GameObject Anm = GameObject.Find("AnmSlider");

        Anm.GetComponent <Slider>().onValueChanged.AddListener((value) => {
            bp.AnimationSpd = value;
        });

        //Scale
        GameObject Sca = GameObject.Find("ScaleSlider");

        Sca.GetComponent <Slider>().onValueChanged.AddListener((value) => {
            bp.Scale = value;
        });

        //Length
        GameObject Len = GameObject.Find("LengthSlider");

        Len.GetComponent <Slider>().onValueChanged.AddListener((value) => {
            bp.MaxLength = value;
        });

        //Color
        GameObject Col = GameObject.Find("ColorSlider");
        float      Add = (2 * Mathf.PI) / 3.0f;

        Col.GetComponent <Slider>().onValueChanged.AddListener((value) => {
            bp.BeamColor.r = Mathf.Max(0, Mathf.Cos(value * 2 * Mathf.PI)) + 0.05f;
            bp.BeamColor.g = Mathf.Max(0, Mathf.Cos(value * 2 * Mathf.PI + Add * 1)) + 0.05f;
            bp.BeamColor.b = Mathf.Max(0, Mathf.Cos(value * 2 * Mathf.PI + Add * 2)) + 0.05f;
        });

        /*
         * //Camera
         * GameObject Cam = GameObject.Find("CameraSlider");
         * //GameObject CamOwner = Camera.main.transform.root.gameObject;
         * GameObject CamOwner = GameObject.Find("CameraOwner");
         *
         * Cam.GetComponent<Slider>().onValueChanged.AddListener((value) => {
         *      CamOwner.transform.rotation = Quaternion.AngleAxis((1.0f-value) * -150.0f,Vector3.up);
         *      //CamOwner.transform.localEulerAngles.Set(0,value * -150.0f,0);
         * });
         */
    }
Example #17
0
    // Use this for initialization
    void Start()
    {
        // Initialise time trackers and current shot
        ColourTimeTracker = EnergyTimeTracker = EnergyCooldownTracker = PowerupDurationTracker = 0.0f;

        // If this is called before an existing beam is ended
        if (CurrentShot != null && CurrentShot.GetComponent <BeamParam>().bGero)
        {
            CurrentShot.GetComponent <BeamParam>().bEnd = true;
        }
        CurrentShot = null;

        // Initialise Audio Component
        AS = gameObject.AddComponent <AudioSource>();
        if (Songs.Length > 0)
        {
            CurrentTrack = 0;
            AS.clip      = Songs[CurrentTrack];
            trackTimes   = new float[Songs.Length];
            for (int i = 0; i < trackTimes.Length; i++)
            {
                trackTimes[i] = 0;
            }
        }
        AS.playOnAwake = false;
        AS.loop        = true;

        // Initialise BeamParam Component
        BP = gameObject.AddComponent <BeamParam>();
        BP.AnimationSpd   = AnimationSpeed;
        BP.Scale          = Scale;
        BP.MaxLength      = MaxLength;
        BP.Damage         = Damage;
        BP.DamageInterval = DamageInterval;

        // Set initial primary shot/beam
        if (ShotTypes.Length > 0)
        {
            Primary = ShotTypes[0];
        }

        // Update all energy listeners
        Energy = 100;
        UpdateListeners();
    }
Example #18
0
 // Use this for initialization
 void Start()
 {
     BP          = GetComponent <BeamParam>();
     LRSize      = 16;
     NowLength   = 0.0f;
     LR          = this.GetComponent <LineRenderer>();
     HitObj      = this.transform.Find("GeroBeamHit").GetComponent <GeroBeamHit>();
     HitObjSize  = HitObj.transform.localScale;
     SHP_Emitter = this.transform.Find("ShotParticle_Emitter").GetComponent <ShotParticleEmitter>();
     Flash       = this.transform.Find("BeamFlash").gameObject;
     F_Vec       = new Vector3[LRSize + 1];
     FlashSize   = Flash.transform.localScale.x;
     for (int i = 0; i < LRSize + 1; i++)
     {
         F_Vec[i] = transform.forward;
     }
     audioSource_Effect0.PlayOneShot(InterferenceSound_start);
 }
Example #19
0
    void Start()
    {
        BeamColor.r = 1.1f;
        BeamColor.g = 0.1f;
        BeamColor.b = 0.1f;

        BeamParam param = GetComponent <BeamParam>();

        if (!param)
        {
            return;
        }

        BeamColor    = param.BeamColor;
        AnimationSpd = param.AnimationSpd;
        Scale        = param.Scale;
        MaxLength    = param.MaxLength;
    }
Example #20
0
    void Start()
    {
        BP               = GetComponent <BeamParam>();
        LR               = GetComponent <LineRenderer>();
        HitObj           = transform.Find("GeroBeamHit").GetComponent <GeroBeamHit>();
        SHP_Emitter      = transform.Find("ShotParticle_Emitter").GetComponent <ShotParticleEmitter>();
        Flash            = transform.Find("BeamFlash").gameObject;
        renderer         = GetComponent <Renderer>();
        flashScaleWiggle = Flash.GetComponent <ScaleWiggle>();
        flashRenderer    = Flash.GetComponent <Renderer>();
        shootableMask    = LayerMask.GetMask("Enemy");

        HitObjSize = HitObj.transform.localScale;
        FlashSize  = Flash.transform.localScale.x;
        MaxLength  = BP.MaxLength;
        BlockLen   = MaxLength / LRSize;
        forwardVec = transform.forward;
    }
Example #21
0
    //method that will call laser stream
    public void FireLaserStream()
    {
        //create laser wave effect
        GameObject wave = (GameObject)Instantiate(laserWavePreFab, transform.position, transform.rotation);

        wave.transform.Rotate(Vector3.left, 90.0f);

        //create constant laser
        currentLaserStream = (GameObject)Instantiate(laserStreamPrefab, transform.position, transform.rotation);

        //use beam param package manipulation
        BeamParam beamParam = GetComponent <BeamParam>();

        if (currentLaserStream.GetComponent <BeamParam>().bGero)
        {
            currentLaserStream.transform.parent = transform;
        }

        //leverage beam parameter settings
        Vector3 beamScale = new Vector3(beamParam.Scale, beamParam.Scale, beamParam.Scale);

        currentLaserStream.transform.localScale = beamScale;
        currentLaserStream.GetComponent <BeamParam>().SetBeamParam(beamParam);
    }
Example #22
0
 // Use this for initialization
 void Start()
 {
     BL = (BeamLine)this.gameObject.transform.FindChild("BeamLine").GetComponent<BeamLine>();
     BP = this.transform.root.gameObject.GetComponent<BeamParam>();
 }
Example #23
0
	// Use this for initialization
	void Start () {
		BL = (BeamLine)this.gameObject.transform.Find("BeamLine").GetComponent<BeamLine>();
		BP = this.transform.root.gameObject.GetComponent<BeamParam>();
	}
Example #24
0
    void Update()
    {
        GameObject Bullet;

        if (Input.GetKeyDown(KeyCode.JoystickButton0) || Input.GetKeyDown(KeyCode.Space))
        {
            if (unityData.GetComponent <Unity_interface> ().readyToShot)
            {
                //if(Input.GetKeyDown(KeyCode.Space)){
                Debug.Log("heee");
                GameObject wav = (GameObject)Instantiate(Wave, this.transform.position, this.transform.rotation);
                wav.transform.Rotate(Vector3.left, 90.0f);
                wav.GetComponent <BeamWave> ().col = this.GetComponent <BeamParam> ().BeamColor;

                Bullet = Shot2;
                //Fire
                NowShot = (GameObject)Instantiate(Bullet, this.transform.position, this.transform.rotation);

                BeamParam bp = this.GetComponent <BeamParam> ();
                if (NowShot.GetComponent <BeamParam> ().bGero)
                {
                    NowShot.transform.parent = transform;
                }

                Vector3 s = new Vector3(bp.Scale, bp.Scale, bp.Scale);

                NowShot.transform.localScale = s;
                NowShot.GetComponent <BeamParam> ().SetBeamParam(bp);

                StartCoroutine(LaserTimer(4.5f));
                StartCoroutine(AlienExplosive(5.5f));
            }
        }
        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (unityData.GetComponent <Unity_interface> ().readyToShot)
            {
                //if(Input.GetKeyDown(KeyCode.Space)){
                Debug.Log("heee");
                GameObject wav = (GameObject)Instantiate(Wave, this.transform.position, this.transform.rotation);
                wav.transform.Rotate(Vector3.left, 90.0f);
                wav.GetComponent <BeamWave> ().col = this.GetComponent <BeamParam> ().BeamColor;

                Bullet = Shot2;
                //Fire
                NowShot = (GameObject)Instantiate(Bullet, this.transform.position, this.transform.rotation);

                BeamParam bp = this.GetComponent <BeamParam> ();
                if (NowShot.GetComponent <BeamParam> ().bGero)
                {
                    NowShot.transform.parent = transform;
                }

                Vector3 s = new Vector3(bp.Scale, bp.Scale, bp.Scale);

                NowShot.transform.localScale = s;
                NowShot.GetComponent <BeamParam> ().SetBeamParam(bp);

                StartCoroutine(LaserTimer(4.5f));
                StartCoroutine(AlienExplosive(5.5f));
            }
        }
    }
Example #25
0
 // Use this for initialization
 void Start()
 {
     BL          = (BeamLine)this.gameObject.transform.FindChild("BeamLine").GetComponent <BeamLine>();
     BP          = this.transform.root.gameObject.GetComponent <BeamParam>();
     whoshooting = GameObject.Find("Player");
 }
 void Start()
 {
     beamParametr     = GetComponent <BeamParam>();
     timeFromLastShot = activeEffectTime;
     scale            = new Vector3(beamParametr.Scale, beamParametr.Scale, beamParametr.Scale); // get scale value from script
 }
Example #27
0
	// Use this for initialization
	void Start () {
		BP = transform.root.gameObject.GetComponent<BeamParam>();
	}