Inheritance: MonoBehaviour
示例#1
0
 void Awake()
 {
     source = GetComponent<AudioSource>();
     t = GetComponent<Text>();
     s = GetComponent<Shadow>();
     originalShadowColor = s.effectColor.a;
 }
示例#2
0
 void Awake()
 {
     if (this.GetComponent<Shadow>() != null)
     {
         shadowComponent = this.GetComponent<Shadow>();
         defaultShadowOpacity = shadowComponent.effectColor.a;
         shadowComponent.useGraphicAlpha = true;
     }
 }
示例#3
0
        /// <inheritdoc/>
        protected override void CloneCore(Shadow source)
        {
            // Clone Shadow properties.
              base.CloneCore(source);

              // Clone CompositeShadow properties.
              var sourceTyped = (CompositeShadow)source;
              for (int i = 0; i < sourceTyped.Shadows.Count; i++)
            Shadows.Add(sourceTyped.Shadows[i].Clone());

              // ShadowMap is not cloned!
        }
    void Start()
    {
        tempCol = new Color(255, 255, 255, 0);

        if(gameOverText != null)
        {
            victoryText = gameOverText.GetComponent<Text>();
            //victoryText.enabled = false;
            victoryOutline = victoryText.GetComponent<Outline>();
            victoryShadow = victoryText.GetComponent<Shadow>();
        }
    }
示例#5
0
        private void Start()
        {
            textComponent = GetComponent <Text>();
            shadow        = GetComponent <Shadow>();

            if (shadow)
            {
                shadow.effectColor = textComponent.color * shadowMultiplier;
            }

            lerpColour = RandomUtilities.Colour();
            lerpColour = new Color(Mathf.Clamp(0.3f, 0.8f, lerpColour.r), Mathf.Clamp(0.2f, 0.8f, lerpColour.g), Mathf.Clamp(0.3f, 0.8f, lerpColour.b));
        }
示例#6
0
 public override int GetHashCode()
 {
     return(Bold.GetHashCode()
            ^ Italic.GetHashCode()
            ^ (Int32)Underline
            ^ Strikethrough.GetHashCode()
            ^ (Int32)VerticalAlignment
            ^ Shadow.GetHashCode()
            ^ FontSize.GetHashCode()
            ^ FontColor.GetHashCode()
            ^ FontName.GetHashCode()
            ^ (Int32)FontFamilyNumbering);
 }
示例#7
0
        private void UpdateShadow()
        {
            this.Container.Layer.ShadowOpacity = 1f;

            var radius = Shadow.GetRadius(this.Element);
            var x      = Shadow.GetX(this.Element);
            var y      = Shadow.GetY(this.Element);
            var color  = Shadow.GetColor(this.Element);

            this.Container.Layer.ShadowRadius = radius;
            this.Container.Layer.ShadowColor  = ColorExtensions.ToCGColor(color);
            this.Container.Layer.ShadowOffset = new CGSize(x, y);
        }
示例#8
0
    private void OnDestroy()
    {
        if (applicationIsQuit)
        {
            return;
        }
        ReleaseShadowMap();
        instance = null;

        Margin4RTDestroy();

        Shader.SetGlobalTexture("_x_shadowMap", Texture2D.whiteTexture);
    }
示例#9
0
        public void Test_Save_ToShadowDatabase()
        {
            Shadow testShadow = new Shadow("Boogie man", "irritable", "intro sentence", "image filepath");

            testShadow.Save();

            List <Shadow> result   = Shadow.GetAll();
            List <Shadow> testList = new List <Shadow> {
                testShadow
            };

            Assert.Equal(testList, result);
        }
示例#10
0
        internal void CopySettings(MenuSettings settings)
        {
            volume = settings.volume;

            shadows              = settings.shadows;
            shadowsQuality       = settings.shadowsQuality;
            antiAliasing         = settings.antiAliasing;
            anisotropicFiltering = settings.anisotropicFiltering;
            realTimeReflections  = settings.realTimeReflections;
            vSync      = settings.vSync;
            resolution = settings.resolution;
            fullScreen = settings.fullScreen;
        }
示例#11
0
        public DropShadowEffect()
        {
            _shadowOpacity = 1;

            _shadowEffect    = new Shadow(Renderer.Context2D);
            _affineEffect    = new AffineTransform2D(Renderer.Context2D);
            _compositeEffect = new Composite(Renderer.Context2D);

            _shadowEffect.BlurStandardDeviation = _blurSize;
            _affineEffect.TransformMatrix       = _transform;

            Colour = Colour.Black;
        }
示例#12
0
    // Use this for initialization
    void Start()
    {
        w = transform.parent.GetComponent <RectTransform> ().rect.width;
        h = transform.parent.GetComponent <RectTransform> ().rect.height;

        rt = gameObject.GetComponent <RectTransform>();

        sh = gameObject.GetComponent <Shadow> ();

        bt_scene                 = gameObject.transform.Find("subpanel_ss").GetComponent <Image>();
        txt_bt_scene_title       = gameObject.transform.Find("subpanel_ss").gameObject.transform.Find("txt_bt_scene_title").GetComponent <Text>();
        txt_bt_scene_short_descr = gameObject.transform.Find("subpanel_ss").gameObject.transform.Find("txt_bt_scene_short_descr").GetComponent <Text>();
    }
    // Use this for initialization
    void Start()
    {
        //This gets the Main Camera from the Scene
        m_MainCamera      = Camera.main;
        is_holding_object = false;
        ShadowObjVars     = GameObject.Find("Shadow Cube").GetComponent <Shadow>();

        // Register for hand and finger events to know where your hand
        // is being tracked and what state it is in.
        InteractionManager.InteractionSourceDetected += InteractionManager_InteractionSourceDetected;
        InteractionManager.InteractionSourceUpdated  += InteractionManager_InteractionSourceUpdated;
        InteractionManager.InteractionSourceLost     += InteractionManager_InteractionSourceLost;
    }
示例#14
0
    /// <summary>
    /// <summary>
    /// Creates an encoded skeleton array from this shadow hierarchy
    /// </summary>
    /// <param name="listType">Whitelist or blacklist</param>
    /// <param name="list">The list of transforms to prune or include</param>
    /// <returns>A potentially sparse array describing this shadow</returns>
    public ShadowTransform[] Encode(
        ShadowTransform[] buffer,
        FilterList <string> nameFilter)
    {
        ShadowCoordinator coordinator = this.controller.Coordinator;

        Shadow.WriteShadowData(
            buffer,
            this._rootHips,
            coordinator,
            nameFilter);
        return(buffer);
    }
示例#15
0
        // Odd thing happens in Unity 5.6.1: if we use Start instead, when instantiating this game object the items are presend and disabled, instead of non-existing
        //void Start()
        //{
        //	if (!_Shadow)
        //		_Shadow = GetComponent<Shadow>();

        //	if (!Application.isPlaying)
        //		return;

        //	// In play mode, destroy it
        //	if (_Shadow)
        //	{
        //		Destroy(_Shadow);
        //		_Shadow = null;
        //	}
        //	Destroy(this);
        //}

#if UNITY_EDITOR
        void Update()
        {
            // No checks during play mode
            if (Application.isPlaying)
            {
                return;
            }

            if (!_Shadow)
            {
                _Shadow = GetComponent <Shadow>();
            }
        }
示例#16
0
 public override void OnEnter()
 {
     component = gameObject.Value.GetComponent <Shadow>();
     if (component == null)
     {
         component = gameObject.Value.AddComponent <Shadow>();
     }
     DoSetShadow();
     if (!everyFrame)
     {
         Finish();
     }
 }
示例#17
0
        public override async Task <bool> CombatBuff()
        {
            if (await Shadow.SummonChocobo())
            {
                return(true);
            }
            if (await Shadow.ChocoboStance())
            {
                return(true);
            }
            if (await Actions.FlamethrowerBuff())
            {
                return(true);
            }
            if (await Actions.BarrelStabilizer())
            {
                return(true);
            }
            if (await Actions.RookAutoturret())
            {
                return(true);
            }
            if (await Actions.RookOverdrive())
            {
                return(true);
            }
            if (await Actions.Hypercharge())
            {
                return(true);
            }
            if (await Actions.GaussRound())
            {
                return(true);
            }
            if (await Actions.Wildfire())
            {
                return(true);
            }
            if (await Actions.Reassemble())
            {
                return(true);
            }
            if (await Actions.Ricochet())
            {
                return(true);
            }
            // Role
            await Helpers.UpdateParty();

            return(false);
        }
        protected override ActionContext DoAction(ActionContext context)
        {
            if (context.Game == null)
            {
                throw new InvalidOperationException("Action context missing required property (Game)");
            }

            if (context.Board == null)
            {
                throw new InvalidOperationException("Action context missing required property (Board)");
            }

            if (context.Origin == null)
            {
                throw new InvalidOperationException("Action context missing required property (Origin)");
            }

            if (context.Target == null)
            {
                throw new InvalidOperationException("Action context missing required property (Target)");
            }

            GameActionData actionData = MakeActionData(context);

            string playerId = context.PlayerId;
            Game   game     = context.Game;
            Board  board    = context.Board;
            Hex    origin   = (Hex)context.Origin;

            PlayerBoard playerBoard = PlayerBoard.Get(game, playerId);

            Scoring.Token[] playerScore = game.Scores[playerId];
            playerBoard.SpendLight(4);
            board[origin] = Tile.Empty;
            playerBoard.Pieces(PieceType.LargeTree).IncreaseOnPlayerBoard();
            if (ScoreTokens.Take(game, origin, out Scoring.Token? token))
            {
                if (token != null)
                {
                    game.Scores[playerId] = playerScore !.Append(token).ToArray();
                }
            }

            PlayerBoard.Set(game, playerId, playerBoard);
            board.Tiles = Shadow.UpdateAllShadows(board, game.SunPosition);
            game.TilesActiveThisTurn =
                game.TilesActiveThisTurn.Where(h => h != origin.HexCode).Append(origin.HexCode).ToArray();

            game.AddGameAction(actionData);
            return(context);
        }
示例#19
0
    void OnLongPressPara(PointerEventData e)
    {
        if (flgDrag)
        {
            return;
        }

        if (!longPressFlg)
        {
            if (GameManager.chkLock(myRegDate) == GameManager.LOCK)
            {
                longPressFlg = false;
                return;
            }
            else
            {
                longPressFlg = true;
            }
            playerPos = this.transform.position;

            Transform pp = this.transform;
            pp.gameObject.AddComponent <Shadow> ();
            sd                = pp.GetComponent <Shadow> ();
            sd.effectColor    = new Vector4(0f, 0f, 0f, 20f / 255f);
            sd.effectDistance = new Vector2(20f, -30f);
            pp.gameObject.AddComponent <Outline> ();
            ol                 = pp.GetComponent <Outline> ();
            ol.effectColor     = new Vector4(0f, 0f, 0f, 30f / 255f);
            ol.effectDistance  = new Vector2(3.0f, 3.0f);
            ol.useGraphicAlpha = true;

            tfOrignParent = this.transform.parent;
            this.transform.SetParent(tfPlayPanel);

            parentPos.x = this.transform.position.x;
            parentPos.y = this.transform.position.y;
            posOffset.x = this.transform.position.x - e.position.x;
            posOffset.y = this.transform.position.y - e.position.y;
            this.transform.SetAsLastSibling();

            // PairがいたらRingを移動のときに消す
            string myPairRegDate = PairManager.getPairRegDate(myRegDate);
            if (myPairRegDate != null)
            {
                GameManager.posPlayerOfRegDate(myPairRegDate);                          //Pairのワーク移動
                flgMyPariMk = this.transform.FindChild("Ring").gameObject.activeSelf;   // 自分のRing有無を保存
                this.transform.FindChild("Ring").gameObject.SetActive(false);
                GameManager.trsPlayer.FindChild("Ring").gameObject.SetActive(false);
            }
        }
    }
示例#20
0
 public override async Task <bool> CombatBuff()
 {
     if (await Shadow.SummonChocobo())
     {
         return(true);
     }
     if (await Shadow.ChocoboStance())
     {
         return(true);
     }
     if (await Actions.CelestialOpposition())
     {
         return(true);
     }
     if (await Actions.LucidDreaming())
     {
         return(true);
     }
     if (Shadow.Settings.AstrologianDraw)
     {
         if (await Actions.LordOfCrowns())
         {
             return(true);
         }
         if (await Actions.SleeveDraw())
         {
             return(true);
         }
         if (await Actions.Draw())
         {
             return(true);
         }
         if (await Actions.Redraw())
         {
             return(true);
         }
         if (await Actions.MinorArcana())
         {
             return(true);
         }
         if (await Actions.Undraw())
         {
             return(true);
         }
         if (await Actions.DrawTargetted())
         {
             return(true);
         }
     }
     return(false);
 }
示例#21
0
        /// <summary>
        /// ダイアログをY軸方向で動かすアニメーション
        /// </summary>
        /// <param name="y">
        /// ダイアログを表示させるY座標
        /// </param>
        /// <param name="up">
        /// ダイアログ、上から出るか下から出るか
        /// </param>
        public async void ShowUp(double y, bool up = true)
        {
            /* ほかのアニメーション中だったら何もしない */
            if (Moving)
            {
                return;
            }

            /* アニメーションフラグを立てる */
            Moving = true;

            /* ダイアログが表示されていたら非表示アニメーションを実行 */
            if (AxisFlag != 0)
            {
                Hide();
            }

            /* 表示軸フラグと方向フラグを立てる */
            AxisFlag      = 1;
            DirectionFlag = 1;

            /* ダイアログを指定座標まで移動 */
            Dialog.IsVisible = true;
            var rc = Dialog.Bounds;

            rc.Y = y - 50;
            await Dialog.TranslateTo(rc.X, rc.Y, 0);



            /* 影表示 */
            Shadow.IsVisible = true;
            rc   = Shadow.Bounds;
            rc.Y = 0;
            await Shadow.TranslateTo(rc.X, 0, 0);

            /* アニメーション */
            for (int cnt = 0, i = up ? 1 : -1; cnt < 5; cnt += i)
            {
                Dialog.Opacity += 0.2;
                Shadow.Opacity += 0.1;

                rc    = Dialog.Bounds;
                rc.Y -= 10;
                await Dialog.LayoutTo(rc, 80);
            }

            /* アニメーションフラグをおろす */
            Moving = false;
        }
示例#22
0
 public void addShadow(Shadow s)
 {
     s.shadowWaveInt = waveIndexes[waveNumber - 1];
     s.shadowWaveStr = waveType [waveIndexes[waveNumber - 1]];
     if (shadowList == null)
     {
         shadowList = new List <Shadow> ();
     }
     shadowList.Add(s);
     if (shadowList.Count == maxShadows)
     {
         state2 = 1;
     }
 }
示例#23
0
        public MenuSettings()
        {
            volume = 1;

            shadows        = Shadow.Soft;
            shadowsQuality = ShadowQuality.Ultra;

            antiAliasing         = AntiAliasing.X8;
            anisotropicFiltering = AnisotropicFiltering.Enable;
            realTimeReflections  = true;
            vSync      = VSync.Half;
            resolution = MaxResolution;
            fullScreen = true;
        }
示例#24
0
 void Awake()
 {
     thisCollider = GetComponent <Collider>();
     shadow       = transform.Find("shadow");
     shadowScript = shadow.GetComponent <Shadow>();
     if (transform.Find("whiteAnim") != null)
     {
         whiteAnimation = transform.Find("whiteAnim").GetComponent <SkeletonAnimation>();
     }
     numberText   = transform.Find("pieceText").gameObject;
     moveParticle = transform.Find("moveParticle").gameObject;
     moveParticle.GetComponent <Renderer>().sortingLayerName = GetComponent <Renderer>().sortingLayerName;
     moveParticle.GetComponent <Renderer>().sortingOrder     = GetComponent <Renderer>().sortingOrder - 2;
 }
示例#25
0
    public void OnEndDrag(PointerEventData e)
    {
        Object.Destroy(sd);
        sd = null;
        Object.Destroy(ol);
        ol = null;

        destItemIndex = placeHolder.transform.GetSiblingIndex();
        MemberManager.movMember(sousceItemIndex, destItemIndex);

        this.transform.parent.SetParent(placeholderParent);
        this.transform.parent.SetSiblingIndex(placeHolder.transform.GetSiblingIndex());
        Destroy(placeHolder);
    }
            public void GetsAndSetsOffsetY()
            {
                // Arrange
                var path    = "myPath";
                var shadow  = new Shadow(path);
                var offsetY = -5;

                // Act
                shadow.OffsetY = offsetY;
                var offsetY2 = shadow.OffsetY;

                // Assert
                Assert.Equal(offsetY, offsetY2);
            }
示例#27
0
        public void Greater_Default()
        {
            // Arrange
            var enchantment = new Shadow(ShadowStrength.Greater);

            // Assert
            Assert.AreEqual("Greater Shadow", enchantment.Name.Text);
            Assert.AreEqual(0, enchantment.SpecialAbilityBonus);
            Assert.AreEqual(33750, enchantment.Cost);
            Assert.AreEqual(15, enchantment.CasterLevel);
            Assert.That(enchantment.GetSchools(),
                        Has.Exactly(1).Matches <School>(s => School.Illusion == s));
            Assert.Throws <ArgumentNullException>(() => enchantment.ApplyTo(null));
        }
            public void GetsAndSetsOffsetX()
            {
                // Arrange
                var path    = "myPath";
                var shadow  = new Shadow(path);
                var offsetX = -5;

                // Act
                shadow.OffsetX = offsetX;
                var offsetX2 = shadow.OffsetX;

                // Assert
                Assert.Equal(offsetX, offsetX2);
            }
示例#29
0
        public override async Task <bool> CombatBuff()
        {
            if (await Shadow.SummonChocobo())
            {
                return(true);
            }
            if (await Shadow.ChocoboStance())
            {
                return(true);
            }
            if (await Actions.Meditate())
            {
                return(true);
            }
            if (await Actions.HissatsuKaiten())
            {
                return(true);
            }
            if (await Actions.HissatsuGyoten())
            {
                return(true);
            }
            if (await Actions.TrueNorth())
            {
                return(true);
            }
            if (await Actions.MeikyoShisui())
            {
                return(true);
            }
            if (await Actions.HissatsuGuren())
            {
                return(true);
            }
            if (await Actions.HissatsuKyuten())
            {
                return(true);
            }
            if (await Actions.HissatsuSeigan())
            {
                return(true);
            }
            if (await Actions.HissatsuShinten())
            {
                return(true);
            }
            await Helpers.UpdateParty();

            return(false);
        }
示例#30
0
        private void RefreshOctant(Point2D point, int octant, int radius)
        {
            ShadowLine line          = new ShadowLine();
            bool       fullShadow    = false;
            int        radiusSquared = radius * radius;

            for (int row = 1; row <= radius; row++)
            {
                int rowSquared = row * row;

                Point2D pos = point + TransformOctant(row, 0, octant);
                if (!_map.InBounds(pos.X, pos.Y))
                {
                    break;
                }

                for (int col = 0; col <= row; col++)
                {
                    Point2D colPos = point + TransformOctant(row, col, octant);

                    if (!_map.InBounds(colPos.X, colPos.Y))
                    {
                        break;
                    }

                    if (rowSquared + col * col > radiusSquared)
                    {
                        break;
                    }

                    if (fullShadow)
                    {
                        _map.SetVisible(colPos.X, colPos.Y, false);
                    }
                    else
                    {
                        Shadow projection = ProjectTile(row, col);

                        bool visible = !line.IsInShadow(projection);
                        _map.SetVisible(colPos.X, colPos.Y, visible);

                        if (visible && _map.IsSolid(colPos.X, colPos.Y))
                        {
                            line.Add(projection);
                            fullShadow = line.IsFullShadow;
                        }
                    }
                }
            }
        }
示例#31
0
            public void Add(Shadow shadow)
            {
                int index = 0;

                for (; index < _shadows.Count; index++)
                {
                    if (_shadows[index].Start > +shadow.Start)
                    {
                        break;
                    }
                }

                Shadow overlappingPrevious = null;

                if (index > 0 && _shadows[index - 1].End > shadow.Start)
                {
                    overlappingPrevious = _shadows[index - 1];
                }

                Shadow overlappingNext = null;

                if (index < _shadows.Count && _shadows[index].Start < shadow.End)
                {
                    overlappingNext = _shadows[index];
                }

                if (overlappingNext != null)
                {
                    if (overlappingPrevious != null)
                    {
                        overlappingPrevious.End = overlappingNext.End;
                        _shadows.RemoveAt(index);
                    }
                    else
                    {
                        overlappingNext.Start = shadow.Start;
                    }
                }
                else
                {
                    if (overlappingPrevious != null)
                    {
                        overlappingPrevious.End = shadow.End;
                    }
                    else
                    {
                        _shadows.Insert(index, shadow);
                    }
                }
            }
示例#32
0
        private void AddShadowEffect(GameObject go, JsonData stateData)
        {
            //"shadow":{"distance":4,"angle":90,"color":"2E1301","alpha":49}

            if (stateData.Keys.Contains(PATTERN_SHADOW) == true)
            {
                Shadow   shadow     = go.AddComponent <Shadow>();
                JsonData shadowData = stateData[PATTERN_SHADOW];
                int      distance   = (int)shadowData["distance"];
                int      angle      = (int)shadowData["angle"];
                shadow.effectDistance = new Vector2(-1 * distance * Mathf.Cos(angle * Mathf.PI / 180.0f), -1 * distance * Mathf.Sin(angle * Mathf.PI / 180.0f));
                shadow.effectColor    = GetColor(shadowData);
            }
        }
示例#33
0
    /// <summary>
    /// Register to the shadow "shadow"
    /// </summary>
    /// <param name="shadow">Shadow who is going to register at the level</param>
    public void RegisterShadow(Shadow shadow)
    {
        //If there is no current LevelManager, exit
        if (Instance == null)
        {
            return;
        }

        //If the shadows collection doesn't already contain this shadow, add it
        if (!shadows.Contains(shadow))
        {
            shadows.Add(shadow);
        }
    }
示例#34
0
 private void DrawShadowMap(SpriteBatch spriteBatch)
 {
     if (editorParams.editingMode == EditingMode.Shadows)
     {
         foreach (EditorShadow editingShadow in shadowList)
         {
             if (editorParams.shadowSide == editingShadow.shadowSide)
             {
                 Shadow shadow = new Shadow(ShadowSpriteController.GetShadowSprite(MapObjectShadowType.BUILDING, editingShadow.shadowSide, editingShadow.shadowId), editingShadow.tileX, editingShadow.tileY, editingShadow.shadowSide, editingShadow.shadowId, new Point(editingShadow.shadowOffsetX, editingShadow.shadowOffsetY));
                 shadow.DrawBuildingEditing(spriteBatch);
             }
         }
     }
 }
示例#35
0
文件: Spell.cs 项目: CumpsD/armorylib
 internal Spell(Arcane arcane,
     Fire fire,
     Frost frost,
     Holy holy,
     Nature nature,
     Shadow shadow,
     ManaRegen manaRegen,
     Hit hit,
     int bonusHealing,
     int spellPenetration,
     PetBonus petBonus)
 {
     Arcane = arcane;
     Fire = fire;
     Frost = frost;
     Holy = holy;
     Nature = nature;
     Shadow = shadow;
     ManaRegen = manaRegen;
     Hit = hit;
     BonusHealing = bonusHealing;
     SpellPenetration = spellPenetration;
     PetBonus = petBonus;
 }
	void Awake() {
		currentLocale = _i18n.getLocale ();
		localeButton = transform.GetComponent<Button> ();
		buttonShadow = transform.GetComponent<Shadow> ();
		updateLocaleButton ();
	}
示例#37
0
    protected void Start()
    {
        this.rectTransform 	= gameObject.GetComponent <RectTransform> ();
        this.image 			= gameObject.GetComponent <Image> ();
        this.shadow 			= gameObject.GetComponent <Shadow> ();

        this.shadow.enabled = false;

        this.CreateConnections ();
    }
示例#38
0
        /// <inheritdoc/>
        protected override void CloneCore(SceneNode source)
        {
            // Clone SceneNode properties.
              base.CloneCore(source);

              // Clone LightNode properties.
              var sourceTyped = (LightNode)source;
              Clip = sourceTyped.Clip;
              InvertClip = sourceTyped.InvertClip;
              Priority = sourceTyped.Priority;
              if (sourceTyped.Shadow != null)
            Shadow = sourceTyped.Shadow.Clone();
        }
 public SmallRedCarpet()
     : base()
 {
     Shadow = new Shadow( 0x21D, 0x21E, 0x21F, 0x220 );
 }
示例#40
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject); // gameObject refers to game object this component is attached to // NOTE IS THERE A BUG? NO RETURN?
        }

        DontDestroyOnLoad(gameObject); // To preserve game data such as score between stages

        mapManagerScript = GetComponent<MapManager>();
        instanceManagerScript = GetComponent<InstanceManager>();
        playerManagerScript = GetComponent<PlayerManager>();

        maskScript = GetComponent<Mask>();
        shadowScript = GetComponent<Shadow>();
        fadeScript = GetComponent<FadeAlphaCutoff>();

        mapMovingObjectScript = GetComponent<MapMovingObject>();
    }
示例#41
0
        public static void GenerateShadow( Mesh polygonGeometry, Matrix worldMatrix, Vector2 lightPosWS,
            float zValue, Vector2 shadowCasterCenter)
        {
            Vector3 UVOffset = new Vector3( 0.0f, -0.5f, 0.0f );

            // Transform the light position into model space
            Vector2 lightPos = Vector2.TransformCoordinate( lightPosWS, Matrix.Invert( worldMatrix ) );

            List<Edge> contourEdges = new List<Edge>();

            for ( int edgeIndex = 0; edgeIndex < polygonGeometry.NumEdges; ++edgeIndex )
            {
                Edge edge = polygonGeometry.GetEdge( edgeIndex );
                Vector2 edgeCenter = ( edge.Vertex1Pos + edge.Vertex2Pos ) * 0.5f;
                Vector2 incidentLightDir = edgeCenter - lightPos;

                // If the edge faces away from the light source
                if ( Vector2.Dot( incidentLightDir, edge.Normal ) >= 0.0f )
                {
                    contourEdges.Add( edge );
                }
            }

            if ( contourEdges.Count < 1 || contourEdges.Count == polygonGeometry.NumEdges )
            {
                return;
            }

            const float ExtrudeMagnitude = 1280;

            Shadow shadow = new Shadow();

            Vector3 lightPosVec3 = new Vector3( lightPos.X, lightPos.Y, zValue );
            lightPosVec3.TransformCoordinate( worldMatrix );

            int quadIndex = 0;
            foreach ( Edge edge in contourEdges )
            {
                Vector3 vertex1 = new Vector3(
                    edge.Vertex1Pos.X, edge.Vertex1Pos.Y, zValue );
                Vector3 vertex2 = new Vector3(
                    edge.Vertex2Pos.X, edge.Vertex2Pos.Y, zValue );

                // Transform the position data from model space to world space
                vertex1.TransformCoordinate( worldMatrix );
                vertex2.TransformCoordinate( worldMatrix );

                Quad quad = new Quad();
                Color shadowColor = Color.FromArgb( 1, 0, 0, 0 );

                quad.Vertices[ 2 * quadIndex + 0 ].Position = vertex1 + UVOffset -
                    18.0f * Vector3.Normalize( vertex1 - lightPosVec3 );
                quad.Vertices[ 2 * quadIndex + 0 ].Color = shadowColor.ToArgb();

                quad.Vertices[ 2 * quadIndex + 1 ].Position = vertex1 + ExtrudeMagnitude * ( vertex1 - lightPosVec3 )
                     + UVOffset;
                quad.Vertices[ 2 * quadIndex + 1 ].Color = shadowColor.ToArgb();

                quad.Vertices[ 2 * quadIndex + 2 ].Position = vertex2 + UVOffset -
                    18.0f * Vector3.Normalize( vertex2 - lightPosVec3 );
                quad.Vertices[ 2 * quadIndex + 2 ].Color = shadowColor.ToArgb();

                quad.Vertices[ 2 * quadIndex + 3 ].Position = vertex2 + ExtrudeMagnitude * ( vertex2 - lightPosVec3 )
                    + UVOffset;
                quad.Vertices[ 2 * quadIndex + 3 ].Color = shadowColor.ToArgb();

                shadow.Quads.Add( quad );
            }

            shadows.Add( shadow );
        }
 public SmallRoyalBlueCarpet()
     : base()
 {
     Shadow = new Shadow( 0x223, 0x224, 0x225, 0x226 );
 }
示例#43
0
        protected void DrawShadowHorizontal(Graphics g, int left, int top, int width, int height, Shadow op)
        {
            if (_layered)
            {
                Color extraColor = Color.FromArgb(64, 0, 0, 0);
                Color darkColor = Color.FromArgb(48, 0, 0, 0);
                Color lightColor = Color.FromArgb(0, 0, 0, 0);

                // Do we need to draw the left shadow?
                if (op != Shadow.Right)
                {
                    if (width >= _shadowLength)
                    {
                        // Draw the remaining middle
                        using(LinearGradientBrush leftBrush = new LinearGradientBrush(new Point(left + _shadowLength, top - _shadowLength),
                                                                                      new Point(left, top + height),
                                                                                      extraColor, lightColor))
                        {
                            // Draw middle shade
                            g.FillRectangle(leftBrush, left, top, _shadowLength, height);

                            left += _shadowLength;
                            width -= _shadowLength;
                        }
                    }
                }

                // Do we need to draw the right shadow?
                if (op != Shadow.Left)
                {
                    if (width >= _shadowLength)
                    {
                        try
                        {
                            g.DrawImageUnscaled(GetShadowCache(_shadowLength, height), left + width - _shadowLength, top);
                        }
                        catch
                        {
                            //	just to be on the safe side...
                        }
                        width -= _shadowLength;
                    }
                }

                // Draw the remaining middle
                using(LinearGradientBrush middleBrush = new LinearGradientBrush(new Point(9999, top),
                                                                                new Point(9999, top + height),
                                                                                darkColor, lightColor))
                {
                    // Draw middle shade
                    g.FillRectangle(middleBrush, left, top, width, height);
                }
            }
            else
            {
                using(SolidBrush shadowBrush = new SolidBrush(ControlPaint.Dark(_backColor)))
                    g.FillRectangle(shadowBrush, left, top, width, height);
            }
        }
示例#44
0
	// Use this for initialization
	void Start () {
		audioSource.clip = audioPlay;
		audioSource.Play ();
		shadowScript = GameObject.Find ("Shadow").GetComponent<Shadow> ();
	}