Пример #1
0
 void Awake()
 {
     originalScale        = transform.localScale;
     targetScale          = hiddenScale;
     transform.localScale = targetScale;
     cam = Camera.main.GetComponent <EffectCamera> ();
 }
Пример #2
0
    public override void Start()
    {
        base.Start();
        if (m_type == ResourceType.Wood)
        {
            SoundPlay.Play("battle_wood_pick", false, false);
        }
        else if (m_type == ResourceType.Gold)
        {
            SoundPlay.Play("gold", false, false);
        }

        //m_fShowEffectCounter = 0.4f;
        Vector3       pos = Vector3.zero;
        CombatInfoWnd Wnd = WndManager.FindDialog <CombatInfoWnd>();

        if (Wnd != null)
        {
            pos = m_uicamera.WorldToViewportPoint(Wnd.GetResourcePos(m_type).position);
        }
        pos.z = 20;//Mathf.Abs(m_target.transform.position.z - m_gameCamera.transform.position.z) * 0.5f;
        pos   = m_gameCamera.ViewportToWorldPoint(pos);
        m_end = m_gameCamera.transform.InverseTransformPoint(pos);
        m_target.transform.parent = m_gameCamera.transform;
        m_start = m_target.transform.localPosition;
        m_target.transform.localScale = Vector3.one;
        EffectCamera.RemoveFollowList(m_target.transform);
    }
Пример #3
0
    static void DropResourceBoxEffect(string name, sdata.s_itemtypeInfo item, Vector3 pos)
    {
        pos    = BattleEnvironmentM.Local2WorldPos(pos);
        pos.x += 0.5f;
        pos.z  = 0;
        GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", name, EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));

        EffectCamera.AddFollowList(gae.transform, pos);
        if (gae != null)
        {
            //先等待
            GameObjectActionBoxWait gaw = new GameObjectActionBoxWait(2f);
            gae.AddAction(gaw);
            //open box
            GameObjectActionOpenBox gaopen = new GameObjectActionOpenBox(2.0f, item);
            gae.AddAction(gaopen);

            Animator ani = gae.gameObject.GetComponent <Animator>();
            if (null != ani)
            {
                int nValue = (int)Random.value % 2;
                if (nValue == 0)
                {
                    nValue = 2;
                }
                ani.SetInteger("iState", nValue);
            }
        }
    }
Пример #4
0
    // Start is called before the first frame update
    void Start()
    {
        activatedBlocks = new List <Block>();

        joints = GetComponentsInChildren <HingeJoint2D>().ToList();
        bodies = GetComponentsInChildren <Rigidbody2D>().ToList();

        lineMaterial = line.material;

        cam = Camera.main.GetComponent <EffectCamera>();
    }
Пример #5
0
    // Use this for initialization
    void Start()
    {
        body       = GetComponent <Rigidbody2D> ();
        spawnPoint = transform.position;
        cam        = Camera.main.GetComponent <EffectCamera> ();

        startPos = transform.position;

        Invoke("ShowWake", 2f);

        if (!Application.isEditor)
        {
            Cursor.visible = false;
        }
    }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        anim = GetComponent <Animator> ();
        cam  = Camera.main.GetComponent <EffectCamera> ();

        if (!endAnim)
        {
            RandomizeSpeed();
        }

        if (isPlayer)
        {
            ActivatePreviousAccessories();
        }
        else
        {
            ActivateCurrentAccessory();
        }
    }
Пример #7
0
    public override void ActionUpdate(float deltatime)
    {
        base.ActionUpdate(deltatime);
        if (SkillTarget != null && m_TimeCount <= m_CallBackTime)
        {
            Vector3 pos = SkillTarget.m_thisT.position;
            //pos.z ;
            m_target.transform.position = EffectCamera.GetEffectPos(pos, 40);
        }

        /* if (SkillTarget!=null && m_TimeCount>=m_CallBackTime && m_TimeCount< m_CallBackTime+Time.deltaTime)
         * {
         *   CombatWnd wnd = WndManager.FindDialog<CombatWnd>();
         *   if (wnd)
         *   {
         *
         *       wnd.ShowSkill9001Effect(SkillTarget.SceneID);
         *   }
         * }*/
    }
Пример #8
0
    // Use this for initialization
    void Start()
    {
        //Start position texture. Assuming dimensions and position RenderTexture are set in
        //inspector.
        SetupPlane();
        Camera cam = camObj.camera;

        cam.Render();

        //Start spring connection texture
        springInitMaterial.SetFloat("_posTexSize", dimensions.x);
        springInitMaterial.SetFloat("_subTexSize", springSubTexSize);
        renderer.material = springInitMaterial;
        dimensions.x     *= springSubTexSize;
        dimensions.y     *= springSubTexSize;
        EffectCamera camScript = camObj.GetComponent("EffectCamera") as EffectCamera;

        camScript.changeRenderTexture(springTex, dimensions);
        SetupPlane();
        cam.Render();
    }
Пример #9
0
    public void ReleaseGodSkill(MapGrid g, Vector3 pos)
    {
        m_ReleaseTimes++;
        m_targetg   = g;
        m_targetpos = pos;

        if (m_godskill.m_type == 9000)
        {
            GameObjectActionExcute gae = EffectM.LoadEffect(EffectM.sPath, "1000041_01", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
            EffectCamera.AddFollowList(gae.transform, pos);
            //gae.gameObject.transform.localPosition = new Vector3(gae.gameObject.transform.localPosition.x,gae.gameObject.transform.localPosition.y,gae.gameObject.transform.localPosition.z-1f);
            GameObjectActionGodSkill9000 ndEffect = new GameObjectActionGodSkill9000();
            ndEffect.SetData(DoGodSkill, m_godskill.m_blackscreentime);
            //ndEffect.m_complete = DoGodSkill;
            SoundPlay.Play("apocalypse_missile_01", false, false);
            SoundPlay.JoinPlayQueue("apocalypse_missile_02", 0f);
            SoundPlay.JoinPlayQueue("apocalypse_missile_03", 0.0f);
            gae.AddAction(ndEffect);
        }
        else if (m_godskill.m_type == 9001)
        {
            //NGUIUtil.DebugLog("使命召唤表现");


            GameObjectActionExcute       gae      = EffectM.LoadEffect(EffectM.sPath, "1000051_01", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
            GameObjectActionGodSkill9001 ndEffect = new GameObjectActionGodSkill9001();
            ndEffect.SetData(DoGodSkill, m_godskill.m_blackscreentime);
            if (m_listSkillTarget.Count > 0)
            {
                Life lifeTarget = m_listSkillTarget[0];
                ndEffect.SkillTarget = lifeTarget;
            }
            SoundPlay.Play("call_of_duty", false, false);
            gae.AddAction(ndEffect);
        }
        else if (m_godskill.m_type == 9002)
        {
            DoGodSkill();
        }
    }
Пример #10
0
    // Use this for initialization
    void Start()
    {
        originalScale = transform.localScale;
        coll          = GetComponent <Collider2D> ();

        shadowScale = shadow.transform.localScale;

        number          = Manager.Instance ? Manager.Instance.GenerateNewNumber() : Random.Range(1, 99);
        numberText.text = number.ToString();

        moves = new List <Vector3> ();

        colorSprite.color = Color.HSVToRGB(Random.value, 0.5f, 0.99f);

        cam = Camera.main.GetComponent <EffectCamera> ();

//		if (Random.value < 0.5f) {
//			colorSprite.transform.localScale = new Vector3 (-colorSprite.transform.localScale.x, colorSprite.transform.localScale.y, colorSprite.transform.localScale.z);
//		}

        colliderSize = GetComponent <BoxCollider2D> ().bounds.size;
    }
Пример #11
0
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }

        demons = new List <Demon>();
        gores  = new List <GameObject>();

        pentagramColor      = pentagramRing.color;
        pentagramClear      = new Color(1, 1, 1, pentagramColor.a);
        pentagramRing.color = Color.clear;
        pentagramDots.color = Color.clear;

        cam = Camera.main.GetComponent <EffectCamera>();
    }
Пример #12
0
    static void DropResourceEffect(string name, ResourceType t, int num, int count, Vector3 pos)
    {
        pos    = BattleEnvironmentM.Local2WorldPos(pos);
        pos.x -= num / 2f;
        for (int i = 0; i < num; i++)
        {
            int n = (int)count / num;
            if (i == 0)
            {
                n += count - num * ((int)count / num);
            }
            pos.x += 1;            //Random.Range(0,2) == 0 ? - Random.Range(0,0.5f*num):Random.Range(0,0.5f*num);
            pos.z  = 0;
            GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", name, EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
            //EffectCamera.AddFollowList(gae.transform,pos);
            if (gae != null)
            {
                Random.seed++;
                GameObjectActionResourceDrop gaw = new GameObjectActionResourceDrop(2f, pos, pos + new Vector3(Random.Range(-1.5f, 1.5f), 0, 0));
                gae.AddAction(gaw);
                GameObjectActionResourceFlyToUI gar = new GameObjectActionResourceFlyToUI();
                gar.SetData(EffectCamera.camera, WndManager.GetNGUICamera(), n, t);
                gae.AddAction(gar);

                Animator ani = gae.gameObject.GetComponent <Animator>();
                if (null != ani)
                {
                    int nValue = (int)Random.value % 2;
                    if (nValue == 0)
                    {
                        nValue = 2;
                    }
                    ani.SetInteger("iState", nValue);
                }
            }
        }
    }
Пример #13
0
    // Use this for initialization
    void Start()
    {
        cam = Camera.main.GetComponent <EffectCamera>();

        horns.sprite = Manager.Instance.GetHorn();
        hair.sprite  = Manager.Instance.GetHair();
        beard.sprite = Manager.Instance.GetHair();

        RandomMirroring(horns.transform);
        RandomMirroring(hair.transform);
        RandomMirroring(beard.transform);

        scaleMod              = Random.Range(0.8f, 1.0f);
        transform.localScale *= scaleMod;

        transform.Rotate(new Vector3(0, 0, Random.Range(0, 360f)));

        Vector3 theSize = transform.localScale;

        transform.localScale = Vector3.zero;
        Tweener.Instance.ScaleTo(transform, theSize, 0.3f, 0f, TweenEasings.BounceEaseOut);

        Cursor.visible = false;
    }
Пример #14
0
 public override void ActionUpdate(float deltatime)
 {
     base.ActionUpdate(deltatime);
     m_target.transform.position = EffectCamera.GetEffectPos(Vector3.Lerp(m_start, m_end, m_TimeCount / 1));
 }
Пример #15
0
 // Use this for initialization
 void Start()
 {
     cam = Camera.main.GetComponent <EffectCamera>();
 }
Пример #16
0
        /// <summary>
        ///     Render a Renderer frame, assuming that the camera is in front of the Renderer and all conditions are met.
        /// </summary>
        /// <param name="camera">The camera rendering the Renderer</param>
        /// <param name="nearClipVerts">The vertices of the camera's near clip plane</param>
        private void TryRender(Camera camera, Vector3[] nearClipVerts)
        {
            if (!Target || !Rendering)
            {
                return;
            }
            //bool isVisible = false;
            var isVisible = false;

            //Check if the camera itself is behind the Renderer, even if the frustum isn't.

            if (!IsMirror)
            {
                if (!SKSGeneralUtils.IsBehind(camera.gameObject.transform.position, Origin.position, Origin.forward))
                {
                    isVisible = true;
                }
                else
                {
                    foreach (var v in nearClipVerts)
                    {
                        if (!SKSGeneralUtils.IsBehind(v, Origin.position, Origin.forward))
                        {
                            isVisible = true;
                            break;
                        }
                    }
                }
            }
            else
            {
                if (SKSGeneralUtils.IsBehind(camera.gameObject.transform.position, Origin.position, Origin.forward))
                {
                    isVisible = true;
                }
                else
                {
                    foreach (var v in nearClipVerts)
                    {
                        if (SKSGeneralUtils.IsBehind(v, Origin.position, Origin.forward))
                        {
                            isVisible = true;
                            break;
                        }
                    }
                }
            }


            if (isVisible || CheeseActivated != -1)
            {
                EffectCamera.RenderIntoMaterial(
                    camera, RenderMaterial,
                    MeshRenderer, Target.MeshRenderer,
                    MeshFilter.mesh, !NonObliqueOverride ? CheeseActivated == -1 : false,
                    Is3D, IsMirror, IsLowqEffect);
            }

            MeshRenderer.GetPropertyBlock(_seamlessRecursionBlock);
            SeamlessRecursionRenderer.SetPropertyBlock(_seamlessRecursionBlock);
        }
Пример #17
0
 public void GoldCoinEffect(int num, int count)
 {
     for (int i = 0; i < num; i++)
     {
         Vector3 pos = MapGrid.GetMG(m_Attr.Pos).pos;            //+new Vector3(Random.Range(1,m_Attr.Size*0.5f-2),-0.5f,1f);
         pos += new Vector3(0, 0.25f, 1.2f);
         pos  = BattleEnvironmentM.Local2WorldPos(pos);
         int n = (int)count / num;
         if (i == 0)
         {
             n += count - num * ((int)count / num);
         }
         GameObjectActionExcute gae = EffectM.LoadEffect("effect/prefab/", "2000041", EffectCamera.GetEffectPos(pos), BattleEnvironmentM.GetLifeMBornNode(true));
         //EffectCamera.AddFollowList(gae.transform,pos);
         if (gae != null)
         {
             GameObjectActionResourceDrop gaw = new GameObjectActionResourceDrop(2f, pos, pos + new Vector3(Random.Range(-1.5f, 1.5f), 0, 0));
             gae.AddAction(gaw);
             GameObjectActionResourceFlyToUI gar = new GameObjectActionResourceFlyToUI();
             gar.SetData(EffectCamera.camera, WndManager.GetNGUICamera(), n, ResourceType.Gold);
             gae.AddAction(gar);
             GameObject coin = U3DUtil.FindChild(gae.gameObject, "coin");
             if (coin != null)
             {
                 coin.GetComponent <ParticleSystem>().startDelay = Random.Range(1f, 1.5f);
             }
         }
     }
 }
Пример #18
0
 // Use this for initialization
 void Start()
 {
     arm.enabled = false;
     cam         = Camera.main.GetComponent <EffectCamera>();
 }