Last active
February 3, 2016 08:07
-
-
Save s2kw/6519978 to your computer and use it in GitHub Desktop.
Inherit Nested Class.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Base : MonoBehaviour{ | |
protected class State | |
{ | |
const int cddc = 0; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Inherited : Base | |
{ | |
private class State:Base.State | |
{ | |
const int abba = 100; | |
} | |
State s; | |
public Inherited():base(){ | |
s = new State(); | |
} | |
public int Member(){ | |
return s.abba; | |
} | |
public int OldMember(){ | |
return s.cddc; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment