Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Custom menus do not work

Discussion in 'Linux' started by nagyv, Dec 27, 2016.

  1. nagyv

    nagyv

    Joined:
    Dec 22, 2016
    Posts:
    4
    Hi,

    I've just installed the plugin from github under Unity Version 5.5.0xp1Linux (59c25c92588f), and can not find the Google Play Games menu. I've looked already all-round.

    There is a "Play Services Resolver" menu under Assets, and there are 2 errors related to plugin files:

    Assets/GooglePlayGames/Platforms/Android/Gms/Games/Stats/LoadPlayerStatsResultObject.cs(28,100): error CS1721: `Com.Google.Android.Gms.Games.Stats.Stats_LoadPlayerStatsResultObject': Classes cannot have multiple base classes (`JavaObjWrapper' and `Result')


    Assets/GooglePlayGames/Platforms/Android/Gms/Games/Stats/Stats.cs(30,52): error CS0527: Type `Result' in interface list is not an interface

    Do you have any ideas what the problem might be?
     
  2. nagyv

    nagyv

    Joined:
    Dec 22, 2016
    Posts:
    4
    I've investigated this further, and the issue is not related to Google Play Services, but to menu extension in general.

    Reproduce:
    1. Create Editor menu under Assets root
    2. Add the following code to a C# script in the Editor folder

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3.  
    4. public class MyMenus
    5. {
    6.     [MenuItem("Tools/My Menu")]
    7.     public static void MenuItemTesting()
    8.     {
    9.         PlayerPrefs.DeleteAll();
    10.     }
    11. }
    12.  
    The script compiles fine, but no new menu is shown.
    3. Restart unity, still no new menu is shown
     
  3. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    I had a similar issue but my menus show just fine..

    this code works in 5.6.0b3 but you will notice that the selection will be greyed out after pressing play if you restart the editor it will work fine until pressing play again

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3. public class MyMenus
    4. {
    5.     [MenuItem("Tools/My Menu")]
    6.     public static void MenuItemTesting()
    7.     {
    8.         PlayerPrefs.DeleteAll();
    9.     }
    10. }
     
    Last edited: Jan 5, 2017
  4. Yuta-Miyoshi

    Yuta-Miyoshi

    Joined:
    Nov 25, 2016
    Posts:
    1
    Are you using a Result class with no namespace?