Exemplo n.º 1
0
        private static void ReviveObject(GridPosition position, Color color, string teamName)
        {
            lock (GridChangeLock)
            {
                GameObject ent = GetObjectAt(position);
                ent.transform.position            = GridPositionToWorld(position);
                aliveGrid[position.X, position.Z] = true;
                if (colorGrid[position.X, position.Z].HasValue)
                {
                    float a = (color.a + colorGrid[position.X, position.Z].Value.a) / 2.0f;
                    float r = (color.r + colorGrid[position.X, position.Z].Value.r) / 2.0f;
                    float g = (color.g + colorGrid[position.X, position.Z].Value.g) / 2.0f;
                    float b = (color.b + colorGrid[position.X, position.Z].Value.b) / 2.0f;
                    colorGrid[position.X, position.Z] = new Color(r, g, b, a);
                }
                else
                {
                    colorGrid[position.X, position.Z] = color;
                }

                EntBehaviorManager manager = ent.GetComponent <EntBehaviorManager>();

                if (StaticController.GlobalEnableColorBlend && StaticController.GlobalColorBlendDistance > 1)
                {
                    manager.Reset(teamName, GetColorInRegion(position, StaticController.GlobalColorBlendDistance));
                }
                else
                {
                    manager.Reset(teamName, color);
                }
            }
        }
Exemplo n.º 2
0
        private static void ReviveObject(GridPosition position, Color color, string teamName)
        {
            lock (GridChangeLock)
            {
                GameObject ent = GetObjectAt(position);
                ent.transform.position            = GridPositionToWorld(position);
                aliveGrid[position.X, position.Z] = true;
                colorGrid[position.X, position.Z] = color;

                EntBehaviorManager manager = ent.GetComponent <EntBehaviorManager>();

                if (StaticController.GlobalEnableColorBlend && StaticController.GlobalColorBlendDistance > 1)
                {
                    manager.Reset(teamName, GetColorInRegion(position, StaticController.GlobalColorBlendDistance));
                }
                else
                {
                    manager.Reset(teamName, color);
                }
            }
        }