Exemplo n.º 1
0
    void Start()
    {
        _userXrCam = User.Instance.GetComponent <Camera>();
        TouchDataIndicator.gameObject.SetActive(false);
        _gridEffectScript = PointMarker.GetComponentInChildren <GridEffect>();

        _inactiveMarkerPos   = Vector3.down * -10000;
        PointMarker.position = _inactiveMarkerPos;
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
//		cusimg = GameObject.Find ("Main Camera").GetComponent<GridEffect> ();
        cusimg = GetComponent <GridEffect> ();


//		if(xint2==0) xint2 = 5;
//		if(yint2==0) yint2 = 5;

        xstep2  = cusimg.Xstep;
        ystep2  = cusimg.Ystep;
        amount2 = cusimg.Amount;
    }
Exemplo n.º 3
0
        void CreateEffect(GridEffect e)
        {
            var position = e.position;
            var direction = e.directionScale;
            float scale = e.directionScale.X;
            MyParticleEffect effect;
            switch (e.Type)
            {
                case GridEffectType.Collision:
                    float cameraDistSq = (float)Vector3D.DistanceSquared(MySector.MainCamera.Position, position);
                    MyParticleEffectsIDEnum effectId;
                    scale = MyPerGameSettings.CollisionParticle.Scale;
                    if (m_grid.GridSizeEnum == MyCubeSize.Large)
                    {
                        effectId = cameraDistSq > MyPerGameSettings.CollisionParticle.CloseDistanceSq ? MyPerGameSettings.CollisionParticle.LargeGridDistant : MyPerGameSettings.CollisionParticle.LargeGridClose;
                    }
                    else
                    {
                        effectId = MyPerGameSettings.CollisionParticle.SmallGridClose;
                        scale = 0.05f;
                    }

                    MatrixD dirMatrix = MatrixD.CreateFromDir(direction);
                    if (MyParticlesManager.TryCreateParticleEffect((int)effectId, out effect))
                    {
                        effect.UserScale = scale;
                        effect.WorldMatrix = MatrixD.CreateWorld(position, dirMatrix.Forward, dirMatrix.Up);
                    }
                    break;

                case GridEffectType.Destruction:
                    scale = MyPerGameSettings.DestructionParticle.Scale;
                    if (m_grid.GridSizeEnum != MyCubeSize.Large)
                        scale = 0.05f;
                    MySyncDestructions.AddDestructionEffect(MyPerGameSettings.DestructionParticle.DestructionSmokeLarge, position, direction, scale);
                    break;

                case GridEffectType.Dust:
                    if (MyParticlesManager.TryCreateParticleEffect((int)MyParticleEffectsIDEnum.Collision_Meteor, out effect))
                    {
                        effect.UserScale = scale;
                        effect.WorldMatrix = MatrixD.CreateFromTransformScale(Quaternion.Identity, position, Vector3D.One);
                    }
                    break;
            }
        }