コード例 #1
0
    public void CmdThrowItem(Vector3 destintation)
    {
        Debug.DrawLine(destintation + new Vector3(0.5f, 0, 0.5f), destintation - new Vector3(0.5f, 0, 0.5f), Color.red, 1f);
        Debug.DrawLine(destintation + new Vector3(-0.5f, 0, 0.5f), destintation - new Vector3(-0.5f, 0, 0.5f), Color.red, 1f);

        GameObject   throwingItemObj = Instantiate(throwingItemPrefab, owner.gameObject.transform.position, Quaternion.identity) as GameObject;
        ThrowingItem throwingItem    = throwingItemObj.GetComponent <ThrowingItem>();

        NetworkServer.Spawn(throwingItemObj);
        throwingItem.Setup(destintation, this.gameObject);
    }
コード例 #2
0
ファイル: Player.cs プロジェクト: babyboucher/EXILED
 /// <summary>
 /// Called before throwing a grenade.
 /// </summary>
 /// <param name="ev">The <see cref="ThrowingItemEventArgs"/> instance.</param>
 public static void OnThrowingItem(ThrowingItemEventArgs ev) => ThrowingItem.InvokeSafely(ev);