示例#1
0
 public Cube(CubeType cubeType, Color color, SpinType spin = SpinType.Spin0)
 {
     _cubeType  = cubeType;
     _backColor = color;
     _spin      = spin;
     Init();
 }
示例#2
0
        public static SpinType Invert(this SpinType spin)
        {
            switch (spin)
            {
            case SpinType.Up:
                return(SpinType.Down);

            case SpinType.Down:
                return(SpinType.Up);

            default:
                throw new ArgumentOutOfRangeException(nameof(spin), spin, null);
            }
        }
示例#3
0
 // Use this for initialization
 protected void Start()
 {
     visible         = false;
     spinType        = SpinType.point;
     lassoSpinOn     = true;
     weaponRotLocked = false;
     step            = 0;
     reticleObject   = Resources.Load("Prefabs/Reticle") as GameObject;
     savedReticleX   = -1;
     savedReticleY   = -1;
     if (GameObject.Find("Armory") != null)
     {
         GameObject.Find("Armory").GetComponent <Armory>().AddWeapon(this);
     }
     attack_time = .1f;
     slow_attack = attack_time;
     MakeVisible();
     Reset();
 }
示例#4
0
    public GravityBody(Rigidbody rb, SpinType spinType = SpinType.axis)
    {
        gravitySource = GravitySource.instance;

        transform         = rb.transform;
        this.rb           = rb;
        rb.useGravity     = false;
        rb.freezeRotation = true;

        this.spinType = spinType;
        mass          = 1;
        isWeightless  = true;

        groundHitBuffer = gravitySource.groundHitBuffer;
        attractingPoint = gravitySource.transform;
        gravitySource.AddGravityObject(this);

        orbision = Orbision.Vector3ToOrbision(rb.position);
    }
    public override void AllocResources()
    {
      base.AllocResources();
      _imageSpinUp.AllocResources();
      _imageSpinUpFocus.AllocResources();
      _imageSpinDown.AllocResources();
      _imageSpinDownFocus.AllocResources();

      _font = GUIFontManager.GetFont(_fontName);
      SetPosition(_positionX, _positionY);

      if (SubItemCount > 0)
      {
        _spinType = SpinType.SPIN_CONTROL_TYPE_TEXT;
        _listLabels.DisposeAndClearList();
        _listValues.DisposeAndClearList();
        for (int i = 0; i < SubItemCount; ++i)
        {
          string subitem = (string)GetSubItem(i);

          _listLabels.Add(subitem);
          _listValues.Add(i);
        }
      }
    }
    public GUISpinControl(int dwParentID, int dwControlId, int dwPosX, int dwPosY, int dwWidth, int dwHeight,
                          string strUp, string strDown, string strUpFocus, string strDownFocus, string strFont,
                          long dwTextColor, SpinType iType, Alignment dwAlign)
      : base(dwParentID, dwControlId, dwPosX, dwPosY, dwWidth, dwHeight)
    {
      _textColor = dwTextColor;
      _fontName = strFont;
      _alignment = dwAlign;
      _spinType = iType;

      _downTextureName = strDown;
      _upTextureName = strUp;
      _upTextureNameFocus = strUpFocus;
      _downTextureNameFocus = strDownFocus;

      FinalizeConstruction();
    }