Esempio n. 1
0
 /// <summary>
 /// Returns a random double number between 0 [inclusive] and 1.0 [exclusive]
 /// </summary>
 /// <returns></returns>
 public double _Range()
 {
     #if AI_LOG
     moduleAI.LogRandomMsg("_Range without parameters");
     #endif
     return(m_random.Range(0, 1.0));
 }
Esempio n. 2
0
    public void PreBuildRandomValue(ulong rSeed)
    {
        PseudoRandom m_random = new PseudoRandom();

        m_random.seed = rSeed;

        foreach (var e in sceneEventInfo.sceneEvents)
        {
            foreach (var b in e.behaviours)
            {
                if (b.sceneBehaviorType == SceneEventInfo.SceneBehaviouType.BuildRandom)
                {
                    SBuildRandomBehaviour be = new SBuildRandomBehaviour(b, null);
                    int maxValue             = be.maxValue;
                    //最后的随机数需要加1,因为策划需要从1~maxValue
                    int random = m_random.Range(1, maxValue == 0 ? 2 : maxValue + 1);
                    m_preBuildRandom.Add(new SRandomInfoConditon(be.randomId, random));
                }
            }
        }
    }