Beispiel #1
0
        public override void OnEnter()
        {
            if (trailOwner.GameObject.Value == null)
            {
                Finish();
            }

            var go = Fsm.GetOwnerDefaultTarget(trailOwner);

            trail = go.gameObject.GetComponent <XWeaponTrail>();

            if (enable.Value == true)
            {
                trail.Activate();
            }
            else
            {
                if (stopSmoothly.Value == true)
                {
                    trail.StopSmoothly(fadeTime.Value);
                }
                else
                {
                    trail.Deactivate();
                }
            }
        }
Beispiel #2
0
        void DoTheMethod()
        {
            var go = Fsm.GetOwnerDefaultTarget(gameObject);

            if (go == null)
            {
                return;
            }

            theScript.Activate();
        }
Beispiel #3
0
    void OnGUI()
    {
        //GUI.Label(new Rect(60, 0, 500, 30), "Pro example requires unity Pro.");

        if (GUI.Button(new Rect(0, 0, 150, 30), "Activate Trail1"))
        {
            ProTrailDistort.Deactivate();
            ProTrailShort.Deactivate();
            ProTraillong.Deactivate();

            SwordAnimation.Play();
            SimpleTrail.Activate();
        }
        if (GUI.Button(new Rect(0, 30, 150, 30), "Stop Trail1"))
        {
            SimpleTrail.Deactivate();
        }
        if (GUI.Button(new Rect(0, 60, 150, 30), "Stop Trail1 Smoothly"))
        {
            SimpleTrail.StopSmoothly(0.3f);
        }


        if (GUI.Button(new Rect(0, 120, 150, 30), "Activate Trail2"))
        {
            SimpleTrail.Deactivate();

            SwordAnimation.Play();
            ProTrailDistort.Activate();
            ProTrailShort.Activate();
            ProTraillong.Activate();
        }
        if (GUI.Button(new Rect(0, 150, 150, 30), "Stop Trail2"))
        {
            ProTrailDistort.Deactivate();
            ProTrailShort.Deactivate();
            ProTraillong.Deactivate();
        }
        if (GUI.Button(new Rect(0, 180, 150, 30), "Stop Trail2 Smoothly"))
        {
            ProTrailDistort.StopSmoothly(0.3f);
            ProTrailShort.StopSmoothly(0.3f);
            ProTraillong.StopSmoothly(0.3f);
        }
    }
    private void OnGUI()
    {
        if (GUI.Button(new Rect(0f, 0f, 150f, 30f), "Activate Trail1"))
        {
            ProTrailDistort.Deactivate();
            ProTrailShort.Deactivate();
            ProTraillong.Deactivate();
            SwordAnimation.Play();
            SimpleTrail.Activate();
        }

        if (GUI.Button(new Rect(0f, 30f, 150f, 30f), "Stop Trail1"))
        {
            SimpleTrail.Deactivate();
        }

        if (GUI.Button(new Rect(0f, 60f, 150f, 30f), "Stop Trail1 Smoothly"))
        {
            SimpleTrail.StopSmoothly(0.3f);
        }

        if (GUI.Button(new Rect(0f, 120f, 150f, 30f), "Activate Trail2"))
        {
            SimpleTrail.Deactivate();
            SwordAnimation.Play();
            ProTrailDistort.Activate();
            ProTrailShort.Activate();
            ProTraillong.Activate();
        }

        if (GUI.Button(new Rect(0f, 150f, 150f, 30f), "Stop Trail2"))
        {
            ProTrailDistort.Deactivate();
            ProTrailShort.Deactivate();
            ProTraillong.Deactivate();
        }

        if (GUI.Button(new Rect(0f, 180f, 150f, 30f), "Stop Trail2 Smoothly"))
        {
            ProTrailDistort.StopSmoothly(0.3f);
            ProTrailShort.StopSmoothly(0.3f);
            ProTraillong.StopSmoothly(0.3f);
        }
    }
    public override void activeWeaponTrail(bool isUse = false)
    {
        if (trail == null)
        {
            GameObject weapon = this.getPartObj(EntityPartType.weapon);
            trail = weapon.GetComponent <XWeaponTrail>();
        }

        if (trail != null)
        {
            if (isUse)
            {
                trail.Activate();
            }
            else
            {
                trail.Deactivate();
            }
        }
    }
 public void TrailPlay()
 {
     Trail.Activate();
 }