Пример #1
0
 public void PlaySound(string soundId, CubeWorld.Utils.Vector3 position)
 {
     if (sounds.ContainsKey(soundId))
     {
         PlayAudioClip(soundId, GraphicsUnity.CubeWorldVector3ToVector3(position), 1.0f);
     }
     else
     {
         Debug.Log("Unknown sound: " + soundId);
     }
 }
Пример #2
0
 public void PlayEffect(string effectId, CubeWorld.Utils.Vector3 position)
 {
     if (effects.ContainsKey(effectId))
     {
         ((GameObject)GameObject.Instantiate(effects[effectId], GraphicsUnity.CubeWorldVector3ToVector3(position), Quaternion.identity)).transform.parent = goContainer.transform;
     }
     else
     {
         Debug.Log("Unknown effect: " + effectId);
     }
 }
Пример #3
0
 static public Vector3 CubeWorldVector3ToVector3(CubeWorld.Utils.Vector3 vec)
 {
     return(new Vector3(vec.x, vec.y, vec.z));
 }
Пример #4
0
        static private Vector3 GetAttributeVector3Value(XmlElement x, string name, Vector3 defaultValue)
        {
            if (string.IsNullOrEmpty(x.GetAttribute(name)) == false)
            {
                string[] s = x.GetAttribute(name).Split(',');
                return new Vector3(
                    float.Parse(s[0], System.Globalization.CultureInfo.InvariantCulture),
                    float.Parse(s[1], System.Globalization.CultureInfo.InvariantCulture),
                    float.Parse(s[2], System.Globalization.CultureInfo.InvariantCulture));
            }

            return defaultValue;
        }