コード例 #1
0
    //the first element should be subscribed to the network node for incoming messages, then use this static collection to direct it to the correct script

    //Don't change the rigidbody mass from 1 to change speed/agility; change accel and maxSpeed instead
    //the rigidbody mass(es) generally only affect how collisions happen
    // Use this for initialization
    void Awake()
    {
        rigid     = GetComponent <Rigidbody2D>();
        _maxSpeed = new FloatStatTracker(initMaxSpeed);
        _accel    = new FloatStatTracker(initAccel);
        _mass     = new FloatStatTracker(rigid.mass, () => rigid.mass = _mass.value);
    }
コード例 #2
0
ファイル: GameStats.cs プロジェクト: hne3/GameProject
 public static void RegisterFloatStat(FloatStatTracker sst)
 {
     floatStatMap.Add(sst.StatName, sst);
 }
コード例 #3
0
 public FloatStat(float val, FloatStatTracker.Recalculate update)
 {
     _value = val;
     this.update = update;
 }