public MechaConfig ExportMechaConfig()
        {
            MechaConfig mechaConfig = new MechaConfig();

            mechaConfig.MechaConfigName = name;

            MechaComponentBase[] mcs = transform.GetComponentsInChildren <MechaComponentBase>();
            foreach (MechaComponentBase mcb in mcs)
            {
                MechaConfig.Config config = new MechaConfig.Config();
                config.MechaComponentKey     = mcb.name;
                config.MechaComponentAlias   = mcb.EditorAlias;
                config.MechaComponentQuality = mcb.EditorQuality;
                config.GridPosR = GridPosR.GetGridPosByLocalTrans(mcb.transform, 1);
                mechaConfig.MechaComponentList.Add(config);
            }

            BehaviourTreeOwner bto = GetComponent <BehaviourTreeOwner>();

            if (bto != null)
            {
                mechaConfig.MechaAIConfigKey = bto.behaviour.name;
            }

            mechaConfig.MechaAIParams = MechaAIParams.Clone();
            return(mechaConfig);
        }
Exemple #2
0
 public void Initialize()
 {
     Orientation = GridPosR.GetGridPosByLocalTrans(transform, ConfigManager.GridSize).orientation;
 }