void Fire(XffectComponent xt)
    {
        int index = Random.Range(0, Targets.Length);

        Transform tar = Targets[index];



        Vector3 center = (tar.position + xt.transform.position) * 0.5f;


        //we need to activate first to retrieve the effectlayer list.
        xt.Active();

        //note you may need to check the specific effectlayer's name here.
        XSplineComponent spline = xt.EffectLayerList[0].EmitSpline;

        //build the spline dynamically.
        spline.RemoveAllPointsExceptFirst();
        spline.AppendWorldPoint(center + Vector3.up * 60f);
        spline.AppendWorldPoint(tar.position);
        spline.ReBuild();


        //set collision target
        xt.SetCollisionGoalPos(tar);
    }
Beispiel #2
0
 void SetUpMissile()
 {
     //must call Active() first!
     Effect.Active();
     Effect.SetCollisionGoalPos(Target.transform, "soul");
     Effect.SetGravityGoal(Target.transform, "soul");
 }
Beispiel #3
0
 void Start()
 {
     //set Attraction goal and Collision goal here.
     Effect.SetArractionAffectorGoal(Target);
     Effect.SetCollisionGoalPos(Target);
 }
    void OnGUI()
    {
        GUI.Label(new Rect(150, 0, 350, 25), "left button to rotate, middle button to pan, wheel to zoom.");
        GUI.Label(new Rect(200, 18, 200, 25), "xffect pro version 3.0.0");

        ScrollPosition    = GUI.BeginScrollView(new Rect(0, 0, 140, 600), ScrollPosition, new Rect(0, 0, 140, 800));
        ShowLightBeams    = GUI.Toggle(new Rect(10, 0, 80, 20), ShowLightBeams, "LightBeams");
        ShowRaining       = GUI.Toggle(new Rect(10, 20, 80, 20), ShowRaining, "Raining");
        ShowVolumeFog     = GUI.Toggle(new Rect(10, 40, 80, 20), ShowVolumeFog, "VolumeFog");
        ShowWaterfall     = GUI.Toggle(new Rect(10, 60, 80, 20), ShowWaterfall, "Waterfall");
        ShowPortalCone    = GUI.Toggle(new Rect(10, 100, 80, 20), ShowPortalCone, "PortalCone");
        ShowTadpoleGate   = GUI.Toggle(new Rect(10, 120, 80, 20), ShowTadpoleGate, "TadpoleGate");
        ShowCrystalEnergy = GUI.Toggle(new Rect(10, 140, 120, 20), ShowCrystalEnergy, "CrystalEnergy");
        ShowSurroundSoul  = GUI.Toggle(new Rect(10, 160, 120, 20), ShowSurroundSoul, "SwingAround");

        if (GUI.Button(new Rect(10, 80, 120, 20), "RadialEnergy"))
        {
            XffectComponent.SetActive(BackgroundWallBottom.gameObject, true);
            m_checkTime = 0f;
            XRadialEnergy.Active();
        }


        if (GUI.Button(new Rect(10, 190, 80, 20), "collision1"))
        {
            XCollisionTest1.Active();
            //show colliders.
            foreach (Transform child in Colliders)
            {
                XffectComponent.SetActive(child.gameObject, true);
            }
            XffectComponent.SetActive(Colliders.gameObject, true);
        }

        if (GUI.Button(new Rect(10, 210, 80, 20), "collision2"))
        {
            XCollisionTest2.Active();
            //set collision goal.
            XCollisionTest2.SetCollisionGoalPos(CollisionGoal);
            //show colliders.
            foreach (Transform child in Colliders)
            {
                XffectComponent.SetActive(child.gameObject, true);
            }
            XffectComponent.SetActive(Colliders.gameObject, true);
        }

        if (GUI.Button(new Rect(10, 240, 80, 20), "missile1"))
        {
            XMissile1.Active();
            XMissile1.transform.position = new Vector3(0, 0, 50);
            SimpleMissile smile = XMissile1.transform.GetComponent <SimpleMissile>();
            smile.Reset();
        }
        if (GUI.Button(new Rect(10, 260, 80, 20), "missile2"))
        {
            XMissile2.Active();
            XMissile2.transform.position = new Vector3(0, 0, 40);
            SimpleMissile smile = XMissile2.transform.GetComponent <SimpleMissile>();
            smile.Reset();
        }
        if (GUI.Button(new Rect(10, 280, 80, 20), "missile3"))
        {
            XMissile3.Active();
            XMissile3.transform.position = new Vector3(0, 0, 40);
            SimpleMissile smile = XMissile3.transform.GetComponent <SimpleMissile>();
            smile.Reset();
        }
        if (GUI.Button(new Rect(10, 300, 80, 20), "missile4"))
        {
            XMissile4.transform.position = new Vector3(0, 0, 40);
            XMissile4.Active();
            SimpleMissile smile = XMissile4.transform.GetComponent <SimpleMissile>();
            smile.Reset();
        }


        if (GUI.Button(new Rect(10, 330, 80, 20), "explosion1"))
        {
            XffectComponent.SetActive(BackgroundWallBottom.gameObject, true);
            m_checkTime = 0f;
            XExplode1.Active();
        }
        if (GUI.Button(new Rect(10, 350, 80, 20), "explosion2"))
        {
            XExplode2.Active();
        }
        if (GUI.Button(new Rect(10, 370, 80, 20), "explosion3"))
        {
            XExplode3.Active();
        }

        if (GUI.Toggle(new Rect(10, 390, 120, 20), ShowPhantomSwordSlash, "PhantomSlash"))
        {
            ShowPhantomSwordSlash = true;
            m_checkTime           = 0f;
            XffectComponent.SetActive(BackgroundWallBottom.gameObject, true);
        }
        else
        {
            ShowPhantomSwordSlash = false;
        }
        ShowPhantomSword = GUI.Toggle(new Rect(10, 410, 120, 20), ShowPhantomSword, "PhantomSword");

        ShowTransformSpell = GUI.Toggle(new Rect(10, 430, 120, 20), ShowTransformSpell, "TransformSpell");

        if (GUI.Button(new Rect(10, 450, 100, 20), "BombAffector"))
        {
            XBombAffector.Active();
        }
        //ver 1.2.1
        ShowSpreadSlash = GUI.Toggle(new Rect(10, 470, 120, 20), ShowSpreadSlash, "SpreadSlash");
        ShowPinkSoul    = GUI.Toggle(new Rect(10, 490, 120, 20), ShowPinkSoul, "PinkSoul");
        ShowSakura      = GUI.Toggle(new Rect(10, 510, 120, 20), ShowSakura, "Sakura");

        //ver 1.2.2
        if (GUI.Button(new Rect(10, 530, 100, 20), "LevelUp"))
        {
            XLevelUp.Active();
        }

        //ver 1.2.3
        ShowIceImpact = GUI.Toggle(new Rect(10, 550, 120, 20), ShowIceImpact, "IceImpact");


        //ver 1.3.1
        if (GUI.Button(new Rect(10, 570, 80, 20), "Dissolve"))
        {
            XffectComponent.SetActive(BackgroundWallBottom.gameObject, true);
            m_checkTime = 0f;
            XDissolve.Active();
        }

        ShowWindowLight      = GUI.Toggle(new Rect(10, 590, 120, 20), ShowWindowLight, "WindowLight");
        ShowVolumetricLight1 = GUI.Toggle(new Rect(10, 610, 120, 20), ShowVolumetricLight1, "VolumetricLight1");
        ShowVolumetricLight2 = GUI.Toggle(new Rect(10, 630, 120, 20), ShowVolumetricLight2, "VolumetricLight2");

        ShowSuckBlood = GUI.Toggle(new Rect(10, 650, 120, 20), ShowSuckBlood, "SuckBlood");

        if (GUI.Button(new Rect(10, 670, 120, 20), "Cyclone1"))
        {
            Cyclone1.Active();
        }

        ShowCyclone2      = GUI.Toggle(new Rect(10, 690, 120, 20), ShowCyclone2, "Cyclone2");
        ShowCyclone3      = GUI.Toggle(new Rect(10, 710, 120, 20), ShowCyclone3, "Cyclone3");
        ShowDevilTrigger  = GUI.Toggle(new Rect(10, 730, 120, 20), ShowDevilTrigger, "Devil Trigger");
        ShowMeshFogVolume = GUI.Toggle(new Rect(10, 750, 120, 20), ShowMeshFogVolume, "MeshFogVolume");
        ShowGlowTrails    = GUI.Toggle(new Rect(10, 770, 120, 20), ShowGlowTrails, "GlowTrails");

        GUI.EndScrollView();
    }