public void SetMatchSimulationManager(MatchSimulationManager matchSimulationManager)
        {
            if (matchSimulationManager != null)
            {
                m_matchSimulationManager = matchSimulationManager;
            }

            m_matchSimulationManager?.Attach(this);
        }
Exemple #2
0
        public void InitializeMatchPlayer(
            ReboundCG.Tennis.Simulation.IMatchPlayer matchPlayer,
            bool reverseDisplay,
            Color playerColor,
            ITennisPlayerLook playerLook,
            IEquipmentItem tech,
            IEquipmentItem outfit,
            IEquipmentItem shoes,
            SignalBus signalBus,
            MatchSimulationManager matchSimulationManager
            )
        {
            m_signalBus = signalBus;
            m_matchSimulationManager = matchSimulationManager;

            if (m_matchData == null)
            {
                m_matchData = new MatchInitializationData();
            }

            m_matchData.MatchPlayer    = matchPlayer;
            m_matchData.ReverseDisplay = reverseDisplay;
            m_matchData.Color          = playerColor;

            m_matchData.PlayerLookData = playerLook;
            m_matchData.TechData       = tech;
            m_matchData.OutfitData     = outfit;
            m_matchData.ShoesData      = shoes;

            if (m_matchData.PlayerLookData != null)
            {
                Gender = m_matchData.PlayerLookData.Gender;
                SetSkinType(m_matchData.PlayerLookData.Skin);
                SetHairdo(m_matchData.PlayerLookData.HairModel);

                if (ColorUtility.TryParseHtmlString(playerLook.HairColor, out Color hairColor))
                {
                    HairColor = hairColor;
                }

                Wristbands = m_matchData.PlayerLookData.Wristbands;
            }

            if (m_matchData.OutfitData != null)
            {
                Outfit = GetOutfitType(m_matchData.OutfitData.Model);

                ColorUtility.TryParseHtmlString(m_matchData.OutfitData.Color2, out Color color2);
                AccessoryColor = color2;

                OutfitBrandId = m_matchData.OutfitData.EquipmentBrandId;
                OutfitId      = m_matchData.OutfitData.Id;
            }

            if (m_matchData.ShoesData != null)
            {
                ShoesBrandId = m_matchData.ShoesData.EquipmentBrandId;
                ShoesId      = m_matchData.ShoesData.Id;
            }

            if (m_matchData.TechData != null)
            {
                RacketBrandId = m_matchData.TechData.EquipmentBrandId;
                RacketId      = m_matchData.TechData.Id;
            }
        }
 public void SetMatchSimulationManager(MatchSimulationManager matchSimulationManager)
 {
     m_matchSimulationManager = matchSimulationManager;
 }