public void OnEnable() { movingPlatform = (StationaryMovingPlatform)target; mObj = new SerializedObject(target); mDuration = mObj.FindProperty("duration"); mStationsList = mObj.FindProperty("stationList"); }