Exemple #1
0
 void Awake()
 {
     currentStep   = 0;
     busModifier   = ScriptableObject.CreateInstance <BusIndicatorModifier>();
     buildingLayer = GameObject.Find("CitySimulatorMap").GetComponent <AbstractMap>().VectorData.GetFeatureSubLayerAtIndex(0);
     busUIManager  = GameObject.Find("BusIndicatorUI").GetComponent <BusUIManager>();
 }
 /// <summary>
 /// Remove game object modifier from the modifiers list
 /// </summary>
 /// <param name="modifier">Game object modifier to be removed from style</param>
 public virtual void RemoveGameObjectModifier(GameObjectModifier modifier)
 {
     if (_subLayerProperties.GoModifiers != null)
     {
         _subLayerProperties.GoModifiers.Remove(modifier);
         _subLayerProperties.HasChanged = true;
     }
 }
 /// <summary>
 /// Add game object modifier to the modifiers list.
 /// </summary>
 /// <param name="modifier">Game object modifier to add to style</param>
 public virtual void AddGameObjectModifier(GameObjectModifier modifier)
 {
     if (_subLayerProperties.GoModifiers == null)
     {
         _subLayerProperties.GoModifiers = new List <GameObjectModifier>();
     }
     _subLayerProperties.GoModifiers.Add(modifier);
     _subLayerProperties.HasChanged = true;
 }
Exemple #4
0
        public T AddOrCreateGameObjectModifier <T>() where T : GameObjectModifier
        {
            GameObjectModifier mod = _defaultStack.GoModifiers.FirstOrDefault(x => x.GetType() == typeof(T));

            if (mod == null)
            {
                mod = (GameObjectModifier)CreateInstance(typeof(T));
                _defaultStack.GoModifiers.Add(mod);
            }
            return((T)mod);
        }
Exemple #5
0
        public T FindGameObjectModifier <T>() where T : GameObjectModifier
        {
            GameObjectModifier mod = _defaultStack.GoModifiers.FirstOrDefault(x => x.GetType() == typeof(T));

            return((T)mod);
        }
Exemple #6
0
 void Start()
 {
     sample_data_i2 = 0;
     sampleModifier = ScriptableObject.CreateInstance <Modifier_Template>();
     buildingLayer  = GameObject.Find("Map").GetComponent <AbstractMap>().VectorData.GetFeatureSubLayerAtIndex(0);
 }
 /// <summary>
 /// Add game object modifier to the modifiers list.
 /// </summary>
 /// <param name="modifier">Game object modifier to add to style</param>
 public virtual void AddGameObjectModifier(GameObjectModifier modifier)
 {
     _subLayerProperties.GoModifiers.Add(modifier);
     _subLayerProperties.HasChanged = true;
 }